
Block No Verify Hook
If you're using Claude Code with pre-commit hooks for linting, formatting, or security checks, you've probably noticed that AI agents will sometimes commit with --no-verify to bypass hook failures. This PreToolUse hook blocks those bypass flags before execution, forcing the agent to work with your quality gates instead of around them. It intercepts Bash tool calls containing --no-verify or --no-gpg-sign in git commands and rejects them with exit code 2. The implementation is a single grep command in your .claude/settings.json that pattern-matches the flags. Simple guardrail that actually enforces the commit standards you bothered to set up.
- skills.sh installs
- 6.9K
- GitHub stars
- 42.4K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add wshobson/agents --skill block-no-verify-hook --agent claude-codeInstalls into .claude/skills of the current project.
Files
Block No-Verify Hook
PreToolUse hook configuration that intercepts and blocks bypass-flag usage before execution, ensuring AI agents cannot skip pre-commit hooks, GPG signing, or other git safety mechanisms.
Overview
AI coding agents (Claude Code, Codex, etc.) can run shell commands with flags like --no-verify that bypass pre-commit hooks. This defeats the purpose of linting, formatting, testing, and security checks configured in pre-commit hooks. The block-no-verify hook adds a PreToolUse guard that rejects any tool call containing bypass flags before execution.
Problem
When AI agents commit code, they may use bypass flags to avoid hook failures:
# These commands skip pre-commit hooks entirely
git commit --no-verify -m "quick fix"
git push --no-verify
git commit --no-gpg-sign -m "unsigned commit"
git merge --no-verify feature-branch
This allows:
- Unformatted code to enter the repository
- Linting errors to bypass checks
- Security scanning to be skipped
- Unsigned commits to bypass signing policies
- Test suites to be circumvented
Solution
Sponsors
Details
- Repository
- github.com/wshobson/agents
- Categories
- Frontend Development, Git & Pull Requests, Code Review & Quality
- First seen
- Apr 16, 2026
More from wshobson/agents
All 174- Signed Audit Trails Recipe6.7K
- Protect Mcp Setup6.3K
- Review Agent Setup5.6K
- Scan5K
- Recsys Pipeline Architect4.6K
- Social Publishing4K
- Before You Build3.5K
- File Conversion3.4K
- Ai Debt Detector3.4K
- Session Guard3.2K
- Dataset Curation3K
- Eval Harness First3K
- Lora Qlora Recipes3K
- Finetuning Method Selection3K
- Preference Optimization2.9K
- Quantized Export2.9K
- Pptx Reference Deck Analysis2.9K
- Grpo Rlvr Training2.9K
- Checkpoint Promotion2.9K
- Trace To Training Data2.9K
- Vision Sft2.9K
- Spark Memory Thermal Ops2.9K
- Spark Training Gotchas2.9K
- Spark Environment Setup2.9K