Skip to content

feat: add block-no-verify PreToolUse hook to protect git hooks#166204

Open
tupe12334 wants to merge 1 commit intocockroachdb:masterfrom
tupe12334:add-block-no-verify
Open

feat: add block-no-verify PreToolUse hook to protect git hooks#166204
tupe12334 wants to merge 1 commit intocockroachdb:masterfrom
tupe12334:add-block-no-verify

Conversation

@tupe12334
Copy link

Summary

Creates .claude/settings.json with block-no-verify@1.1.2 as a PreToolUse Bash hook to prevent Claude Code agents from bypassing git hooks via the hook-skip flag.

Details

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. block-no-verify reads tool_input.command from the Claude Code hook stdin payload, detects the hook-bypass flag across all git subcommands, and exits 2 to block. The existing .claude/agents, .claude/rules, and .claude/skills are unchanged.

Closes #166203


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

Prevents agents from bypassing git hooks via the hook-skip flag.

Closes cockroachdb#166203
@trunk-io
Copy link
Contributor

trunk-io bot commented Mar 19, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@blathers-crl
Copy link

blathers-crl bot commented Mar 19, 2026

Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

I was unable to automatically find a reviewer. You can try CCing one of the following members:

  • A person you worked with closely on this PR.
  • The person who created the ticket, or a CRDB organization member involved with the ticket (author, commenter, etc.).
  • Join our community slack channel and ask on #contributors.
  • Try find someone else from here.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-untriaged blathers was unable to find an owner labels Mar 19, 2026
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@cockroachlabs-cla-agent
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-community Originated from the community T-dev-inf X-blathers-untriaged blathers was unable to find an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add block-no-verify PreToolUse hook to protect git hooks

3 participants