Skip to content

Add block-no-verify PreToolUse hook to .claude/settings.json #193

@tupe12334

Description

@tupe12334

Feature: Add block-no-verify PreToolUse hook to .claude/settings.json

ui-ux-pro-max-skill has .claude/skills committed but no settings.json — there's no enforcement against agents bypassing git hooks via the hook-skip flag.

When Claude Code runs git commit or git push with the hook-bypass flag, it silently skips pre-commit hooks, commit-msg validation, and pre-push test suites — regardless of any quality gates configured elsewhere.

Proposed fix

Create .claude/settings.json with block-no-verify@1.1.2 (github.com/tupe12334/block-no-verify) as a PreToolUse Bash hook:

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

The package reads tool_input.command from the Claude Code PreToolUse stdin payload, detects the hook-bypass flag across all git subcommands, and exits 2 to block. No custom scripts needed.


Disclosure: I am the author and maintainer of block-no-verify.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions