wshobson avatar

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-code

Installs 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
1clerk avatarclerk-expo-patternsclerk/skillsExpo / React Native patterns with Clerk — SecureStore token cache, OAuth deep linking, useAuth in native, Expo Router protected routes, push notifications with 6.8Kskills.sh installs
2pixijs avatarpixijs-createpixijs/pixijs-skillsUse this skill when scaffolding a new PixiJS v8 project with the create-pixi CLI or adding PixiJS to an existing project. Covers npm/yarn/pnpm/bun create comman6.8Kskills.sh installs
3wshobson avatarsigned-audit-trails-recipewshobson/agentsStep-by-step cookbook for setting up cryptographically signed audit trails on Claude Code tool calls. Use when explaining, evaluating, or demonstrating the patt6.7Kskills.sh installs
4assistant-ui avatarstreamingassistant-ui/skillsStreaming backends and wire protocols for assistant-ui via the assistant-stream package. Use when building a custom (non-AI-SDK) streaming endpoint with createA6.7Kskills.sh installs
5manaflow-ai avatarcmux-diagnosticsmanaflow-ai/cmuxRun end-user cmux diagnostics. Use when cmux hooks, notifications, session restore, settings, browser automation, socket access, CLI control, or agent resume be6.6Kskills.sh installs
6pixijs avatarpixijs-accessibilitypixijs/pixijs-skillsUse this skill when adding screen reader and keyboard navigation to PixiJS v8 apps. Covers AccessibilitySystem options (enabledByDefault, debug, activateOnTab, 6.6Kskills.sh installs