What are Claude Code Hooks?
Claude Code Hooks are built-in automation triggers that run shell commands on events like file edits and tool calls. Automatically execute code linting, tests, and validation.
In one sentence: Claude Code's built-in automation system runs lint, tests, and custom validation automatically on file edits and tool calls.
For: Developers who want to automate quality checks in their Claude Code workflow.
Core Features
1. Event Types
PreToolUse, PostToolUse, Notification, Stop, SubagentStop.
2. Tool Matchers
Match specific tools with regex (Edit, Write, Bash, etc.).
3. Common Patterns
Auto-lint, run tests, type-check, block commits without tests.
4. Output Feedback
Hook output is fed back as context to guide Claude's next steps.
FAQ
Q: Will it slow down Claude Code? A: Runs synchronously — keep commands under 2 seconds.
Q: Where does the config file go?
A: Project-level .claude/settings.json or global ~/.claude/settings.json.