Claude Code hooks are the only rules an agent can't forget in a long session. But a hook that never fires fails silently: no error, no warning, just an agent doing the thing you thought you'd blocked. Here are seven mistakes I see most in .claude/settings.json , and one in .mcp.json .
1. A lower-case matcher
{ "matcher" : "bash" , "hooks" : [ ... ] }
Enter fullscreen mode
Exit fullscreen mode
Tool names are case-sensitive. bash matches nothing; it has to be Bash . Same for Edit , Write , Read .
2. The hook object without its wrapper
"PostToolUse" : [ { "type" : "command" , "command" : "npx prettier --write" } ]
Enter fullscreen mode
Exit fullscreen mode
Each event takes an array of groups , and each group has its own hooks array:
"PostToolUse" : [ { "matcher" : "Edit|Write|MultiEdit" , "hooks" : [ { "type" : "command" , "command" : "npx prettier --write" } ] } ]
Enter fullscreen mode
Exit fullscreen mode
3.…