-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Description
Summary
Add the block-no-verify package to prevent AI coding assistants from bypassing git hooks using the --no-verify flag.
Problem
This codebase uses Husky with lint-staged to enforce code quality:
stop-onlychecks on test filesbiome check --writeon TypeScript/JavaScript/JSON files
AI coding assistants (Claude Code, Cursor, Gemini CLI) can bypass these checks by running git commit --no-verify, which defeats the purpose of the pre-commit 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 configuration for Claude Code, Cursor, and Gemini CLI
Configuration Required
- For Claude Code - Create
.claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "pnpm dlx block-no-verify"
}
]
}
]
}
}- For Cursor - Create/update
.cursor/hooks.json:
{
"beforeShellExecution": {
"command": "pnpm dlx block-no-verify"
}
}Benefits
- Enforces code quality checks even when using AI assistants
- MIT licensed, lightweight dependency
- No changes needed to existing Husky/lint-staged setup
- Maintains consistency with the existing
.cursor/configuration approach
References
Reactions are currently unavailable