Classic Tool Use, Session, and Task Types
Types with Fields
Each type below has its own table of fields.
PreToolUseDecision
The decision of a classic.PreToolUse result: allow, ask, deny, or none.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
allow | Documented: An official docs page names this item. | Lets the call run without a permission prompt. The managed-settings hooks ran first. A deny from them ended the chain above. | Type: true. |
ask | Documented: An official docs page names this item. | Never set in this form. | Type: undefined. Optional. |
deny | Documented: An official docs page names this item. | Never set in this form. | Type: undefined. Optional. |
ask | Documented: An official docs page names this item. | Asks the user before the call runs. The engine displays the text as the reason. | Type: string. |
allow | Documented: An official docs page names this item. | Never set in this form. | Type: undefined. Optional. |
deny | Documented: An official docs page names this item. | Never set in this form. | Type: undefined. Optional. |
deny | Documented: An official docs page names this item. | Refuses the call. The model receives the text as the reason. | Type: string. |
allow | Documented: An official docs page names this item. | Never set in this form. | Type: undefined. Optional. |
ask | Documented: An official docs page names this item. | Never set in this form. | Type: undefined. Optional. |
allow | Documented: An official docs page names this item. | Never set in this form. | Type: undefined. Optional. |
ask | Documented: An official docs page names this item. | Never set in this form. | Type: undefined. Optional. |
deny | Documented: An official docs page names this item. | Never set in this form. | Type: undefined. Optional. |
PreToolUseHookInput
Combines PreToolUseHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Pre. | Type: 'Pre. |
tool_ | Documented: An official docs page names this item. | The name of the tool. | Type: string. |
tool_ | Documented: An official docs page names this item. | The arguments the tool was called with. | Type: unknown. |
tool_ | Documented: An official docs page names this item. | The ID of the tool call. | Type: string. |
mcp_ | Documented: An official docs page names this item. | The MCP server the tool comes from, for an mcp__ tool. | Type: Mcp. Optional. |
PreToolUseResult
What a classic.PreToolUse hook returns: one of allow, ask, deny, or none of them. None passes the call on to the normal permission flow. Intersection of PreToolUseResult and PreToolUseDecision. The event fires inside tool.call, beneath the tool.call hook of every plugin.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
updated | Documented: An official docs page names this item. | Replaces the arguments of the tool. The engine checks them against the schema of the tool before the tool runs. | Type: Record<string, unknown>. Optional. |
additional | Documented: An official docs page names this item. | Extra context handed to the model with the call, one entry for each note. | Type: string[]. Optional. |
SessionEndHookInput
Combines SessionEndHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Session. | Type: 'Session. |
reason | Documented: An official docs page names this item. | Why the session ended. | Type: Exit. |
SessionStartHookInput
Combines SessionStartHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Session. | Type: 'Session. |
source | Documented: An official docs page names this item. | How the session started: startup, resume, clear, compact, or fork. | Type: 'startup' | 'resume' | 'clear' | 'compact' | 'fork'. |
agent_ | Documented: An official docs page names this item. | The agent type name, when the session started with --. | Type: string. Optional. |
model | Documented: An official docs page names this item. | The model in use at the start. | Type: string. Optional. |
session_ | Documented: An official docs page names this item. | The title of the session. | Type: string. Optional. |
seconds_ | Documented: An official docs page names this item. | resume/fork: seconds since the last assistant response of the resumed transcript | Type: number. Optional. |
context_ | Documented: An official docs page names this item. | resume/fork: the input + cache_read + cache_creation + output tokens of the last response of the resumed transcript. For a server-side tool loop, it is the window of its last iteration, not the summed totals. | Type: number. Optional. |
prompt_ | Documented: An official docs page names this item. | resume/fork: seconds_since_last_response exceeds the prompt-cache TTL, so the first request re-caches context_tokens | Type: boolean. Optional. |
estimated_ | Documented: An official docs page names this item. | resume/fork: estimated cost of re-caching context_tokens on the session model. It uses the managed modelPricing when set, otherwise list price. It excludes the response | Type: number. Optional. |
SetupHookInput
Combines SetupHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Setup. | Type: 'Setup'. |
trigger | Documented: An official docs page names this item. | What ran setup: init or maintenance. | Type: 'init' | 'maintenance'. |
StopFailureHookInput
Combines StopFailureHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Stop. | Type: 'Stop. |
error | Documented: An official docs page names this item. | The error that ended the turn. | Type: SDKAssistant. |
error_ | Documented: An official docs page names this item. | More detail about the error. | Type: string. Optional. |
last_ | Documented: An official docs page names this item. | The rendered API error text that the conversation displays, such as API Error:. It is not the own words of Claude. | Type: string. Optional. See StopFailure input. |
StopHookInput
Combines StopHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Stop. | Type: 'Stop'. |
stop_ | Documented: An official docs page names this item. | true when a stop hook already continued the turn. Check it to avoid loops. | Type: boolean. |
last_ | Documented: An official docs page names this item. | Text content of the last assistant message before stopping. You do not need to read and parse the transcript file. | Type: string. Optional. |
background_ | Documented: An official docs page names this item. | In-flight background work in this session. Lets a hook tell "session is done" from "session is paused for background work". Empty when nothing is in flight. | Type: Background. Optional. |
session_ | Documented: An official docs page names this item. | Session-scoped cron tasks (CronCreate, ScheduleWakeup, /loop) that will wake this session later. Empty array when none are scheduled. | Type: Session. Optional. |
SubagentStartHookInput
Combines SubagentStartHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Subagent. | Type: 'Subagent. |
agent_ | Documented: An official docs page names this item. | The ID of the subagent. | Type: string. |
agent_ | Documented: An official docs page names this item. | The agent type name of the subagent. | Type: string. |
SubagentStopHookInput
Combines SubagentStopHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Subagent. | Type: 'Subagent. |
stop_ | Documented: An official docs page names this item. | true when a stop hook already continued the turn. Check it to avoid loops. | Type: boolean. |
agent_ | Documented: An official docs page names this item. | The ID of the subagent. | Type: string. |
agent_ | Documented: An official docs page names this item. | Path to the subagent transcript. transcript_ is the main one. | Type: string. |
agent_ | Documented: An official docs page names this item. | The agent type name, such as general-. | Type: string. |
last_ | Documented: An official docs page names this item. | Text content of the last assistant message before stopping. You do not need to read and parse the transcript file. | Type: string. Optional. |
background_ | Documented: An official docs page names this item. | In-flight background work in this session. Lets a hook tell "session is done" from "session is paused for background work". Empty when nothing is in flight. | Type: Background. Optional. |
session_ | Documented: An official docs page names this item. | Session-scoped cron tasks (CronCreate, ScheduleWakeup, /loop) that will wake this session later. Empty array when none are scheduled. | Type: Session. Optional. |
TaskCompletedHookInput
Combines TaskCompletedHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Task. | Type: 'Task. |
task_ | Documented: An official docs page names this item. | The ID of the task. | Type: string. |
task_ | Documented: An official docs page names this item. | The title of the task. | Type: string. |
task_ | Documented: An official docs page names this item. | The longer text of the task. | Type: string. Optional. |
teammate_ | Documented: An official docs page names this item. | The name of the teammate. | Type: string. Optional. |
team_ | Documented: An official docs page names this item. | The name of the team. | Type: string. Optional. Deprecated: Sessions have a single implicit team. This carries the session-derived team name and will be removed in a future release. |
TaskCreatedHookInput
Combines TaskCreatedHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Task. | Type: 'Task. |
task_ | Documented: An official docs page names this item. | The ID of the task. | Type: string. |
task_ | Documented: An official docs page names this item. | The title of the task. | Type: string. |
task_ | Documented: An official docs page names this item. | The longer text of the task. | Type: string. Optional. |
teammate_ | Documented: An official docs page names this item. | The name of the teammate. | Type: string. Optional. |
team_ | Documented: An official docs page names this item. | The name of the team. | Type: string. Optional. Deprecated: Sessions have a single implicit team. This carries the session-derived team name and will be removed in a future release. |
TeammateIdleHookInput
Combines TeammateIdleHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Teammate. | Type: 'Teammate. |
teammate_ | Documented: An official docs page names this item. | The name of the idle teammate. | Type: string. |
team_ | Documented: An official docs page names this item. | The name of the team. | Type: string. Deprecated: Sessions have a single implicit team. This carries the session-derived team name and will be removed in a future release. |
UserPromptExpansionHookInput
Combines UserPromptExpansionHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always User. | Type: 'User. |
expansion_ | Documented: An official docs page names this item. | What expanded: slash_ or mcp_. | Type: 'slash_. |
command_ | Documented: An official docs page names this item. | The name of the command. | Type: string. |
command_ | Documented: An official docs page names this item. | The arguments given to the command. | Type: string. |
command_ | Documented: An official docs page names this item. | Where the command came from, such as plugin. | Type: string. Optional. |
prompt | Documented: An official docs page names this item. | The prompt text. | Type: string. |
UserPromptSubmitHookInput
Combines UserPromptSubmitHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always User. | Type: 'User. |
prompt | Documented: An official docs page names this item. | The text the person submitted. | Type: string. |
source | Documented: An official docs page names this item. | Who wrote the prompt: user (interactive), sdk (- or Agent SDK), loop_, schedule_, system (machine-injected), or poll_. Payloads may omit it. | Type: 'user' | 'sdk' | 'system' | 'loop_. Optional. |
session_ | Documented: An official docs page names this item. | The title of the session. | Type: string. Optional. |
WorktreeCreateHookInput
Combines WorktreeCreateHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Worktree. | Type: 'Worktree. |
name | Documented: An official docs page names this item. | The name of the worktree to create. | Type: string. |
WorktreeRemoveHookInput
Combines WorktreeRemoveHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Worktree. | Type: 'Worktree. |
worktree_ | Documented: An official docs page names this item. | The path of the worktree to remove. | Type: string. |