Skip to content

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

Open
tupe12334 wants to merge 1 commit intofacebook:mainfrom
tupe12334:add-block-no-verify
Open

Add block-no-verify PreToolUse hook to .claude/settings.json#36105
tupe12334 wants to merge 1 commit intofacebook:mainfrom
tupe12334:add-block-no-verify

Conversation

@tupe12334
Copy link

Summary

Adds block-no-verify@1.1.2 as a PreToolUse Bash hook in .claude/settings.json, alongside the existing SessionStart hook.

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, detects the hook-bypass flag across all git subcommands, and exits 2 to block.

Note on deny: Bash(npx:*): The deny list applies to what Claude Code can run via its Bash tool. Hooks run as system-level shell commands outside that permission scope, so this hook works correctly regardless.

All existing SessionStart hooks and permissions are preserved unchanged.

Closes #36104


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

Prevents agents from bypassing git hooks via the hook-skip flag.
Note: hooks run as system shell commands outside Claude's permission scope,
so this works correctly even with deny: Bash(npx:*).
Closes facebook#36104
@meta-cla
Copy link

meta-cla bot commented Mar 19, 2026

Hi @tupe12334!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant