Skip to content

Add block-no-verify hook to prevent agents from bypassing git hooks #3673

@tupe12334

Description

@tupe12334

Describe the feature

Sim is an AI workflow builder that uses both Claude Code and Cursor. Neither .claude/settings.json nor .cursor/hooks.json currently exist — meaning there's no enforcement against agents bypassing git hooks via the hook-skip flag.

When an agent runs git commit or git push with the hook-bypass flag, it silently disables pre-commit, commit-msg, and pre-push hooks. Linters, type-checkers, and tests can all be skipped without any warning.

Proposed solution

Add block-no-verify@1.1.2 (github.com/tupe12334/block-no-verify) to both agent configs:

Claude Code — create .claude/settings.json:

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

Cursor — create .cursor/hooks.json:

{
  "hooks": {
    "beforeShellExecution": [
      { "command": "npx block-no-verify@1.1.2", "event": "beforeShellExecution" }
    ]
  }
}

Zero custom logic — the package handles detection and blocking.


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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions