Skip to content

Commit c8f631b

Browse files
tupe12334claude
andauthored
feat: add block-no-verify hook for Claude Code and Cursor (anomalyco#649)
Adds npx [email protected] as a PreToolUse Bash hook in hooks/hooks.json and a beforeShellExecution hook in .cursor/hooks.json to prevent AI agents from bypassing git hooks via the hook-bypass flag. This closes the last enforcement gap in the ECC security stack — the bypass flag silently skips pre-commit, commit-msg, and pre-push hooks. Closes anomalyco#648 Co-authored-by: Claude Sonnet 4.6 <[email protected]>
1 parent 8511d84 commit c8f631b

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎.cursor/hooks.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
}
1616
],
1717
"beforeShellExecution": [
18+
{
19+
"command": "npx [email protected]",
20+
"event": "beforeShellExecution",
21+
"description": "Block git hook-bypass flag to protect pre-commit, commit-msg, and pre-push hooks from being skipped"
22+
},
1823
{
1924
"command": "node .cursor/hooks/before-shell-execution.js",
2025
"event": "beforeShellExecution",

‎hooks/hooks.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
"$schema": "https://json.schemastore.org/claude-code-settings.json",
33
"hooks": {
44
"PreToolUse": [
5+
{
6+
"matcher": "Bash",
7+
"hooks": [
8+
{
9+
"type": "command",
10+
"command": "npx [email protected]"
11+
}
12+
],
13+
"description": "Block git hook-bypass flag to protect pre-commit, commit-msg, and pre-push hooks from being skipped"
14+
},
515
{
616
"matcher": "Bash",
717
"hooks": [

0 commit comments

Comments
 (0)