Skip to content

Commit acf52ff

Browse files
Code review fixes: harden hook assets
- protect-paths.json: case-insensitive path match (Secrets.json, SECRET_KEY.txt now blocked) and broaden *secrets* -> *secret* - notify-on-stop.json: strip quotes/backslashes from the notification message so osascript can't be broken by message content CI/deploy/build review: 0 bugs (pipeline verified to pass on first run). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d59eed5 commit acf52ff

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

assets/hooks/notify-on-stop.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"hooks": [
1818
{
1919
"type": "command",
20-
"command": "msg=$(jq -r '.message // \"Claude Code needs your attention.\"'); osascript -e \"display notification \\\"$msg\\\" with title \\\"Claude Code\\\" sound name \\\"Glass\\\"\""
20+
"command": "msg=$(jq -r '.message // \"Claude Code needs your attention.\"' | tr -d '\"\\\\'); osascript -e \"display notification \\\"$msg\\\" with title \\\"Claude Code\\\" sound name \\\"Glass\\\"\""
2121
}
2222
]
2323
}

assets/hooks/protect-paths.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"hooks": [
77
{
88
"type": "command",
9-
"command": "f=$(jq -r '.tool_input.file_path // empty'); case \"$f\" in *.env|*.env.*|*/.env|*/.env.*|*secrets*|*/migrations/*|*.pem|*.key|*id_rsa*) echo \"Blocked: $f is a protected path. Edit it manually if you really mean to.\" >&2; exit 2 ;; esac; exit 0"
9+
"command": "f=$(jq -r '.tool_input.file_path // empty'); lf=$(printf '%s' \"$f\" | tr 'A-Z' 'a-z'); case \"$lf\" in *.env|*.env.*|*/.env|*/.env.*|*secret*|*/migrations/*|*.pem|*.key|*id_rsa*) echo \"Blocked: $f is a protected path. Edit it manually if you really mean to.\" >&2; exit 2 ;; esac; exit 0"
1010
}
1111
]
1212
}

0 commit comments

Comments
 (0)