-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Open
Description
Summary
Add the block-no-verify package to prevent AI coding agents from bypassing git hooks using the --no-verify flag.
Problem
AI coding agents (Claude Code, Gemini CLI) can bypass pre-commit hooks by running git commit --no-verify, which defeats the purpose of code quality checks enforced by git hooks.
Proposed Solution
Integrate block-no-verify (v1.1.1) which:
- Monitors git commands (
commit,push,merge,cherry-pick,rebase,am) - Blocks execution when
--no-verifyor-nflag is detected - Supports both Claude Code and Gemini CLI
Configuration Required
For Claude Code - Create .claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "npx block-no-verify"
}
]
}
]
}
}For Gemini CLI - Create .gemini/settings.json:
{
"hooks": {
"BeforeTool": [
{
"matcher": "shell",
"hooks": [
{
"type": "command",
"command": "npx block-no-verify"
}
]
}
]
}
}Benefits
- Enforces code quality checks even when using AI agents
- MIT licensed, lightweight dependency
- No changes needed to existing git hooks setup
References
Metadata
Metadata
Assignees
Labels
No labels