#[non_exhaustive]pub enum HookEventKind {
Show 33 variants
PreToolUse,
PostToolUse,
PostToolUseFailure,
PostToolBatch,
Notification,
UserPromptSubmit,
UserPromptExpansion,
SessionStart,
SessionEnd,
Stop,
StopFailure,
SubagentStart,
SubagentStop,
PreCompact,
PostCompact,
PreModelSwitch,
PostModelSwitch,
PermissionRequest,
PermissionDenied,
Setup,
TeammateIdle,
TaskCreated,
TaskCompleted,
Elicitation,
ElicitationResult,
ConfigChange,
WorktreeCreate,
WorktreeRemove,
InstructionsLoaded,
CwdChanged,
FileChanged,
DirectoryAdded,
MessageDisplay,
}Expand description
All 33 hook event kinds. Source: chunk-20bv8pca.js:12053–12087 (N2 array)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PreToolUse
Before tool execution.
PostToolUse
After tool execution.
PostToolUseFailure
After tool execution fails.
PostToolBatch
After a batch of tool calls resolves.
Notification
When notifications are sent.
UserPromptSubmit
When the user submits a prompt.
UserPromptExpansion
When a user-typed slash command expands into a prompt.
SessionStart
When a new session is started.
SessionEnd
When a session is ending.
Stop
Right before Claude concludes its response.
StopFailure
When the turn ends due to an API error.
SubagentStart
When a subagent (Agent tool call) is started.
SubagentStop
Right before a subagent (Agent tool call) concludes its response.
PreCompact
Before conversation compaction.
PostCompact
After conversation compaction.
PreModelSwitch
Before a requested model switch (/model, model picker, set_model).
PostModelSwitch
After the session model changes (any cause).
PermissionRequest
When a permission dialog is displayed.
PermissionDenied
After auto mode denies a tool call.
Setup
Repo setup hooks for init and maintenance.
TeammateIdle
When a teammate is about to go idle.
TaskCreated
When a task is being created.
TaskCompleted
When a task is being marked as completed.
Elicitation
When an MCP server requests user input (elicitation).
ElicitationResult
After a user responds to an MCP elicitation.
ConfigChange
When configuration files change during a session.
WorktreeCreate
Create an isolated worktree for VCS-agnostic isolation.
WorktreeRemove
Remove a previously created worktree.
InstructionsLoaded
When an instruction file (CLAUDE.md or rule) is loaded.
CwdChanged
After the working directory changes.
FileChanged
When a watched file changes.
DirectoryAdded
After a working directory is added mid-session.
MessageDisplay
While assistant message text is displayed.