Hooks

2026-11-24Claude Code 2.1.332Model: Opus 5.5ultrathink
▾

Events

eventfired in the capturepayload fields
MessageDisplayyes11
PostCompactyes8
PostToolBatchyes11
PostToolUseyes15
PostToolUseFailureyes14
PreCompactyes8
PreToolUseyes13
SessionEndyes7
SessionStartyes8
Stopyes12
StopFailureyes8
SubagentStartyes8
SubagentStopyes15
UserPromptSubmityes8
ConfigChangeno
CwdChangedno
DirectoryAddedno
Elicitationno
ElicitationResultno
FileChangedno
InstructionsLoadedno
Notificationno
PermissionDeniedno
PermissionRequestno
PostModelSwitchno
PreModelSwitchno
PreSkillShellCommandno
Setupno
TaskCompletedno
TaskCreatedno
TeammateIdleno
UserPromptExpansionno
WorktreeCreateno
WorktreeRemoveno
▾

MessageDisplay

fieldvalues seen
cwd
delta
final
hook_event_name
index
message_id
prompt_id
scratchpad_dir
session_id
transcript_path
turn_id
▾

PostCompact

fieldvalues seen
compact_summary
cwd
hook_event_name
prompt_id
scratchpad_dir
session_id
transcript_path
triggermanual
▾

PostToolBatch

fieldvalues seen
agent_id
agent_typegeneral-purpose
cwd
effort
hook_event_name
permission_modebypassPermissions
prompt_id
scratchpad_dir
session_id
tool_calls
transcript_path
▾

PostToolUse

fieldvalues seen
agent_id
agent_typegeneral-purpose
cwd
duration_ms
effort
hook_event_name
permission_modebypassPermissions
prompt_id
scratchpad_dir
session_id
tool_input
tool_nameAgent Bash
tool_response
tool_use_id
transcript_path
▾

PostToolUseFailure

fieldvalues seen
cwd
duration_ms
effort
errorExit code 1
hook_event_name
is_interrupt
permission_modebypassPermissions
prompt_id
scratchpad_dir
session_id
tool_input
tool_nameBash
tool_use_id
transcript_path
▾

PreCompact

fieldvalues seen
custom_instructions
cwd
hook_event_name
prompt_id
scratchpad_dir
session_id
transcript_path
triggermanual
▾

PreToolUse

fieldvalues seen
agent_id
agent_typegeneral-purpose
cwd
effort
hook_event_name
permission_modebypassPermissions
prompt_id
scratchpad_dir
session_id
tool_input
tool_nameAgent Bash
tool_use_id
transcript_path
▾

SessionEnd

fieldvalues seen
cwd
hook_event_name
prompt_id
reasonother prompt_input_exit
scratchpad_dir
session_id
transcript_path
▾

SessionStart

fieldvalues seen
cwd
hook_event_name
model
prompt_id
scratchpad_dir
session_id
sourcecompact startup
transcript_path
▾

Stop

fieldvalues seen
background_tasks
cwd
effort
hook_event_name
last_assistant_message
permission_modebypassPermissions
prompt_id
scratchpad_dir
session_crons
session_id
stop_hook_active
transcript_path
▾

StopFailure

fieldvalues seen
cwd
effort
errormodel_not_found
hook_event_name
last_assistant_message
prompt_id
session_id
transcript_path
▾

SubagentStart

fieldvalues seen
agent_id
agent_typegeneral-purpose
cwd
hook_event_name
prompt_id
scratchpad_dir
session_id
transcript_path
▾

SubagentStop

fieldvalues seen
agent_id
agent_transcript_path
agent_type general-purpose
background_tasks
cwd
effort
hook_event_name
last_assistant_message
permission_modebypassPermissions
prompt_id
scratchpad_dir
session_crons
session_id
stop_hook_active
transcript_path
▾

UserPromptSubmit

fieldvalues seen
cwd
hook_event_name
permission_modebypassPermissions default
prompt
prompt_id
scratchpad_dir
session_id
transcript_path