-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
Open
Description
Add block-no-verify as a Claude Code PreToolUse hook
When a Claude Code agent runs git commit or git push with the hook-bypass flag, it silently disables pre-commit, commit-msg, and pre-push hooks — defeating any quality gates you've put in place.
block-no-verify is a lightweight Claude Code hook that detects the hook-bypass flag across all git subcommands and exits 2 to block the command.
Proposed change to .claude/settings.json
Add a PreToolUse Bash hook:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{ "type": "command", "command": "npx block-no-verify@1.1.2" }]
}
]
}
}This keeps agents from bypassing your git hooks without explicit human override.
Disclosure: I am the author and maintainer of block-no-verify.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
In progress