Skip to content

Add block-no-verify to prevent AI agents from bypassing git hooks #890

@tupe12334

Description

@tupe12334

Problem\n\nThis repo uses Claude Code (via .claude/ config and packages/happy-app/.claude/settings.json) to assist with development. A common risk with AI coding agents is that they sometimes invoke git commands with flags that skip pre-commit hooks, linters, tests, and other quality gates.\n\nFor a project like Happy, which handles end-to-end encrypted communication between mobile clients and Claude Code, maintaining code quality and security checks at commit time is especially important.\n\n## Solution\n\nblock-no-verify (https://github.com/tupe12334/block-no-verify) is a lightweight npm package (version 1.1.2) that intercepts any git commit or push that attempts to skip hooks and blocks it before execution.\n\nAdd this to packages/happy-app/.claude/settings.json:\n\n{ hooks: { PreToolUse: [ { matcher: Bash, hooks: [ { type: command, command: npx --yes block-no-verify@1.1.2 } ] } ] } }\n\n## Why this matters\n\n- Claude Code can autonomously run shell commands, including git commits that skip hooks\n- block-no-verify adds a zero-config safety net with no runtime overhead for normal commits\n- Package: https://github.com/tupe12334/block-no-verify version 1.1.2\n\nDisclosure: 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