Summary
The block-no-verify PreToolUse hook (wired via the plugin's hooks/hooks.json, currently npx block-no-verify@1.1.2) over-matches: it blocks git commit whenever the literal string --no-verify (or no-verify) appears anywhere in the command string, including inside the commit message body — not just when it is actually passed as a flag.
Impact
Legitimate commits are blocked when their message merely mentions the flag. Real-world examples that get blocked even though no --no-verify flag is passed:
- A commit documenting the hook itself, or a docs change that explains "don't use
--no-verify".
- Any commit whose body references bypassing git hooks by name.
In a recent session this fired twice on legitimate commits whose message bodies referenced the flag, forcing the message to be reworded before the commit would go through. (Ironically, even a commit message containing the hook's own name, block-no-verify, is blocked because it contains the substring no-verify.)
Reproduction
# No --no-verify flag is passed, yet this is blocked:
git commit -m "docs: explain why we never pass --no-verify"
Result: BLOCKED: --no-verify flag is not allowed with git commit. Git hooks must not be bypassed.
Suggested fix
Tighten the matcher to detect --no-verify (and -n for commit, if covered) only in flag/argument position, not as a substring of the whole command — e.g.:
- Match the token only when it appears as a standalone argument (word-boundary / argv element), and
- Exclude content that is part of the commit message (after
-m/-F, or inside a heredoc body).
This preserves the safety guarantee (you still can't actually bypass hooks) while removing the false positives on message bodies.
Environment
block-no-verify@1.1.2 invoked as a Claude Code PreToolUse Bash hook via the ECC plugin's hooks/hooks.json.
- Observed on macOS, Claude Code, ECC plugin 1.9.0.
Thanks for ECC — the safety-guard hooks are great; this is just a matcher-scope refinement.
Summary
The
block-no-verifyPreToolUse hook (wired via the plugin'shooks/hooks.json, currentlynpx block-no-verify@1.1.2) over-matches: it blocksgit commitwhenever the literal string--no-verify(orno-verify) appears anywhere in the command string, including inside the commit message body — not just when it is actually passed as a flag.Impact
Legitimate commits are blocked when their message merely mentions the flag. Real-world examples that get blocked even though no
--no-verifyflag is passed:--no-verify".In a recent session this fired twice on legitimate commits whose message bodies referenced the flag, forcing the message to be reworded before the commit would go through. (Ironically, even a commit message containing the hook's own name,
block-no-verify, is blocked because it contains the substringno-verify.)Reproduction
Result:
BLOCKED: --no-verify flag is not allowed with git commit. Git hooks must not be bypassed.Suggested fix
Tighten the matcher to detect
--no-verify(and-nfor commit, if covered) only in flag/argument position, not as a substring of the whole command — e.g.:-m/-F, or inside a heredoc body).This preserves the safety guarantee (you still can't actually bypass hooks) while removing the false positives on message bodies.
Environment
block-no-verify@1.1.2invoked as a Claude Code PreToolUseBashhook via the ECC plugin'shooks/hooks.json.Thanks for ECC — the safety-guard hooks are great; this is just a matcher-scope refinement.