claude-codehooklisted
Install: claude install-skill bendrucker/claude
# Claude Code Hooks
Reference for creating and configuring Claude Code hooks. When uncertain about syntax or features, use the `Agent` tool with `subagent_type='claude-code-guide'` to consult official docs.
## Hook Types
| Type | Trigger | Use Cases |
|------|---------|-----------|
| PreToolUse | Before tool execution | Validate inputs, block operations, modify parameters |
| PostToolUse | After tool completes | Check results, run linters, provide feedback |
| UserPromptSubmit | When user sends message | Pre-process input, add context |
| PermissionRequest | Permission dialog appears | Return a decision, notify a remote approver |
| Stop | Agent finishes a turn | Cleanup, save state |
| StopFailure | Agent stops on failure | Report the failure |
| SubagentStart / SubagentStop | Subagent spawns / completes | Process results |
| SessionStart / SessionEnd | Session begins / ends | Inject context, export state |
| PreCompact / PostCompact | Around context compaction | Save important state |
| Notification | System notification | Log events |
| TeammateIdle | Teammate about to go idle | Hand off work |
## Configuration Files
- `~/.claude/settings.json` - User-level (global)
- `.claude/settings.json` - Project-level
- `.claude/settings.local.json` - Local (not committed)
- Plugin hooks: `plugins/<name>/hooks/hooks.json`
## Hook Structure
```json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "co