⌨️Command Hook
Also known as type: command
A hook that runs a shell command and reads JSON from its input.
Think of it like
It is like a note that says run this now.
Example
Lucy writes a small script that reads the tool input with jq. A command hook runs it before each Bash call.
Why it matters
It is the most common hook type, and the other kinds answer in the same JSON shape.
Definition
Example code
json
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/check.sh"
}Common mistake
Key takeaways
- 1Runs a command. In a shell.
- 2JSON in, answer out. stdin, exit code.
- 3Your full rights. Read it first.