Shell hooks that execute in response to Claude Code events like tool calls, file changes, and task completion.
Automate everything.
Hooks make development faster and more consistent
Hooks are shell scripts that execute automatically in response to Claude Code events. Use them to automate formatting, testing, type generation, and more.
Execute when specific Claude Code tools are called.
Execute when files are written.
Execute on task events.
bash - After bash commandread - After reading filewrite - After writing fileedit - After editing fileglob - After globbing filesgrep - After greppingtodo - Load current cycle contextdone - Mark cycle completesubmit - When user submits prompterror - When operation failsHooks are discovered in .claude/hooks/ directory. Name files after the event.
Make executable with chmod +x .claude/hooks/*
How this feature maps to the 6-dimension ontology
Hooks are automation things
Hooks execute on events like tool_called, file_written
Execute code when specific tools are called
Trigger on file write/edit events
Execute on task completion, error, etc.
Access context via env vars
Hooks can trigger other hooks
Format code when files are edited
Execute tests before committing code
Auto-generate TypeScript types from schema
moderate
24h
88%
99/100