#[non_exhaustive]pub enum HookEventName {
Show 21 variants
SessionStart,
UserPromptSubmit,
PreToolUse,
PermissionRequest,
PostToolUse,
PreLLMCall,
PostLLMCall,
PreCompact,
PostCompact,
SubagentStart,
SubagentStop,
Stop,
SessionEnd,
Notification,
PostToolUseFailure,
StopFailure,
PostToolBatch,
Interrupt,
SessionFork,
ToolUseStart,
Unknown(String),
}Expand description
Hook event names: the lowercase-first-letter spelling of every
HookEventKind::all() variant. Open: a future event value is additive.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SessionStart
sessionStart: a session starts, resumes, is cleared, is forked, or
continues after compaction.
UserPromptSubmit
userPromptSubmit: the user submits a prompt, before the model sees it.
PreToolUse
preToolUse: a tool call has been validated and is about to run.
PermissionRequest
permissionRequest: a tool call is waiting for approval.
PostToolUse
postToolUse: a tool call finished successfully.
PreLLMCall
preLLMCall: a model request is about to be sent.
PostLLMCall
postLLMCall: a model response was received.
PreCompact
preCompact: context compaction is about to run.
PostCompact
postCompact: context compaction finished.
SubagentStart
subagentStart: a child agent session starts during a turn.
SubagentStop
subagentStop: a child agent session is about to stop.
Stop
stop: the model is about to end the turn.
SessionEnd
sessionEnd: the session shuts down. Observation only.
Notification
notification: the session is waiting on the user, for example on a
pending approval or a new question. Observation only.
PostToolUseFailure
postToolUseFailure: a tool call failed.
StopFailure
stopFailure: the turn ended because the model call failed. Observation
only.
PostToolBatch
postToolBatch: one batch of tool results was committed.
Interrupt
interrupt: a top-level turn was cancelled. Observation only, and never
sent for a child agent’s turn.
SessionFork
sessionFork: a fork of the session has completed. The host waits for
the handler’s verdict, which decides how the fork is presented (such
as its tab label) but cannot block the fork.
ToolUseStart
toolUseStart: an approved tool call is about to start running.
Observation only.
Unknown(String)
A value from a newer host, kept verbatim so an older client decodes the rest of the message. Never construct it with a known word.