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