Hook Events in AI

From the Claude Code cheat sheet ยท Hooks System ยท verified Jul 2026

Hook Events

Available hook trigger points

bash
# Hook events:
PreToolUse       # Before tool execution
PostToolUse      # After tool execution
UserPromptSubmit # When user sends message
Notification     # System notifications
Stop             # When stopping execution
SubagentStop     # When subagent stops
PreCompact       # Before context compaction
SessionStart     # Session begins
SessionEnd       # Session ends

# Configure via:
/hooks           # Interactive configuration
# Or edit ~/.claude/settings.json directly
๐Ÿ“Œ Hooks run at specific events
๐Ÿ” Can run commands or scripts
๐Ÿ“Œ Useful for logging and automation
hooks

More AI tasks

Back to the full Claude Code cheat sheet