Marked as helpful by the asker
Two things:
- The matcher is case sensitive and matches tool names. The tools are
Edit,Write,MultiEdit, notedit. Use"matcher": "Edit|MultiEdit|Write". - Formatting
.on every edit is slow on a real project. The hook gets JSON on stdin with the file path, so format only that file:
{
"type": "command",
"command": "jq -r '.tool_input.file_path' | xargs npx prettier --write"
}Run /hooks inside Claude Code to see what it actually loaded. Hooks are read when the session starts, so after editing the file start a new session (or review them in /hooks).
/hooksinside Claude Code list it at all? chidi_eze · edited