feat: Add block-no-verify to prevent AI agents from bypassing git hooks

Resolved 💬 3 comments Opened Jan 10, 2026 by tupe12334 Closed Feb 24, 2026

Summary

Add the block-no-verify package to prevent AI coding agents from bypassing git hooks using the --no-verify flag.

Problem

AI coding agents (Claude Code, Gemini CLI) can bypass pre-commit hooks by running git commit --no-verify, which defeats the purpose of code quality checks enforced by git 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-verify or -n flag is detected
  • Supports both Claude Code and Gemini CLI

Configuration Required

For Claude Code - Create .claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "npx block-no-verify"
          }
        ]
      }
    ]
  }
}

For Gemini CLI - Create .gemini/settings.json:

{
  "hooks": {
    "BeforeTool": [
      {
        "matcher": "shell",
        "hooks": [
          {
            "type": "command",
            "command": "npx block-no-verify"
          }
        ]
      }
    ]
  }
}

Benefits

  • Enforces code quality checks even when using AI agents
  • MIT licensed, lightweight dependency
  • No changes needed to existing git hooks setup

References

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗