Created
February 6, 2026 22:17
-
-
Save mimoo/549124666de4fd7be8ee6c8dc8f6ccd4 to your computer and use it in GitHub Desktop.
Revisions
-
mimoo created this gist
Feb 6, 2026 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ # NO MORE DB PUSH Annoying agents. Claude, codex, gemini, they all suck, they always use `db push` directly with prisma and co. We don't want them to! So we must tell them to stop!!!! Add to .claude/settings.json in your project: ```json { "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-prisma-db-push.sh" } ] } ] } } ``` Then create `.claude/hooks/block-prisma-db-push.sh:` ```bash #!/bin/bash INPUT=$(cat) COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command') if echo "$COMMAND" | grep -q "prisma db push"; then jq -n '{ hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "deny", permissionDecisionReason: "NEVER use prisma db push — it bypasses migration history. Use bun run db:migrate:dev instead. If that fails due to drift, ask the user." } }' fi ``` And chmod +x it.