Skip to content

Block No-Verify Hook

Stops AI coding agents from skipping git pre-commit checks with --no-verify flags

Repository
wshobson/agents
Stars
42,095
Licence
MIT
Files
1 file

What it does

This skill sets up a small guard in a Claude Code project that watches every shell command the agent tries to run. If a git commit or push uses a flag like --no-verify or --no-gpg-sign that would skip the project's pre-commit checks (linting, formatting, tests, security scans) or commit signing, the guard rejects the command before it runs and tells the agent to commit normally so the checks can execute.

Great for

  • Teams that use pre-commit hooks for linting, formatting, testing or security checks and want AI agents to respect them
  • Maintainers setting up Claude Code projects that enforce commit quality gates
  • Organisations with commit signing policies that want agents kept inside them

Skip it if

  • Projects with no pre-commit hooks, where the guard adds setup without benefit
  • Anyone expecting a hard security boundary: the check matches text, so an agent deliberately trying to evade it (for example by building the flag from pieces or using git -c core.hooksPath=/dev/null) can get past it
  • Setups that rely on the guard alone to stop a bad commit: it only blocks bypass flags, not the bad code itself

Try asking

  • “Set up a block on --no-verify commits in this project so the agent can't skip our pre-commit checks”
  • “Add the block-no-verify hook to my .claude/settings.json”
  • “Make sure commits made by the agent in this repo always run the pre-commit hooks”
  • “Extend the commit guard to also block git push --force”
Step-by-step guide: how to use Block No-Verify HookInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    block-no-verify-hook.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip block-no-verify-hook.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip block-no-verify-hook.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Install it per project in .claude/settings.json so it is committed and shared with the team, or globally in ~/.claude/settings.json to cover all projects.
  • After installing, test with a harmless commit using --no-verify to confirm it is blocked, and a normal commit to confirm it passes.
  • Treat it as a guardrail against habitual bypasses, and pair it with server-side checks such as CI, since a determined agent can evade text matching.

What's inside

  • SKILL.md

Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.