Classic Result, Config, and Elicitation Types
Types with Fields
Each type below has its own table of fields.
BackgroundTaskSummary
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
id | Documented: An official docs page names this item. | The ID of the background task. | Type: string. |
type | Documented: An official docs page names this item. | Friendly task-type label (for example 'shell', 'subagent', 'monitor', 'workflow'). It falls back to the raw discriminant for unknown types. | Type: string. |
status | Documented: An official docs page names this item. | The status of the background task. | Type: string. |
description | Documented: An official docs page names this item. | Free-text description. Capped at 1000 chars. Clipped values append an in-string "... [+N chars]" marker. | Type: string. |
command | Documented: An official docs page names this item. | Shell command line. Only present for 'shell' tasks. Capped at 1000 chars with the same "... [+N chars]" marker. | Type: string. Optional. |
agent_ | Documented: An official docs page names this item. | Subagent type name. Only present for 'subagent' tasks. | Type: string. Optional. |
server | Documented: An official docs page names this item. | MCP server name. Only present for 'monitor' / 'MCP task' tasks. | Type: string. Optional. |
tool | Documented: An official docs page names this item. | MCP tool name. Only present for 'monitor' / 'MCP task' tasks. | Type: string. Optional. |
name | Documented: An official docs page names this item. | Workflow name. Only present for 'workflow' tasks. | Type: string. Optional. |
BaseHookInput
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
session_ | Documented: An official docs page names this item. | The ID of the current session. | Type: string. |
transcript_ | Documented: An official docs page names this item. | Path to the conversation JSONL file. See Transcript Format. | Type: string. |
cwd | Documented: An official docs page names this item. | The working directory when the hook fires. | Type: string. |
prompt_ | Documented: An official docs page names this item. | A UUID that ties a user prompt to all later events until the next prompt. It is also the prompt. attribute on OpenTelemetry events. Absent until the first user input. | Type: string. Optional. |
permission_ | Documented: An official docs page names this item. | The permission mode in force, such as default, plan, or accept. See Input and Output. | Type: string. Optional. |
agent_ | Documented: An official docs page names this item. | Subagent identifier. Present only when the hook fires inside a subagent. Absent on the main thread. Use it, not agent_, to tell subagent calls apart. | Type: string. Optional. |
agent_ | Documented: An official docs page names this item. | Agent type name, such as general-. Present inside a subagent, or on the main thread of a session started with --. | Type: string. Optional. |
effort | Documented: An official docs page names this item. | Reasoning effort of the current turn. Present for hooks in a tool-use context on a model that supports effort. Absent for session-lifecycle hooks. | Type: object. Optional. |
ClassicEventOf
The classic (settings) hook events, one for each classic event name. e is the whole stdin input of the hook, with the base fields (transcript_path, cwd) included. Object. One key for each classic event. The chain is managed settings hooks, then hooks modules, then the other settings hooks. A managed block ends it above every module.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
[E in Classic | Documented: An official docs page names this item. | The input of each classic. event: the tool-call envelope for classic., the hook input for the rest. | Type: E extends 'Pre. |
ClassicResult
Everything that the answer of a classic hook event can carry, named as the JSON output of the classic hook names it. Each event reads its subset (ClassicResultOf). The settings hooks fold into one of these. A field of the wrong shape fails the hook.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
block | Documented: An official docs page names this item. | decision: with this text as reason (a command hook's exit code 2): the block, veto or re-prompt of the event. | Type: string. Optional. |
prevent | Documented: An official docs page names this item. | continue:: the session stops after this event. | Type: true. Optional. |
stop | Documented: An official docs page names this item. | Displayed when prevent stops the session (stop). | Type: string. Optional. |
additional | Documented: An official docs page names this item. | hook, one entry for each hook: text handed to the model with the event. | Type: string[]. Optional. |
session | Documented: An official docs page names this item. | hook (UserPromptSubmit, SessionStart). | Type: string. Optional. |
suppress | Documented: An official docs page names this item. | hook (UserPromptSubmit, UserPromptExpansion). | Type: true. Optional. |
initial | Documented: An official docs page names this item. | hook (SessionStart). | Type: string. Optional. |
watch | Documented: An official docs page names this item. | hook (SessionStart). | Type: string[]. Optional. |
reload | Documented: An official docs page names this item. | hook (SessionStart). | Type: true. Optional. |
permission | Documented: An official docs page names this item. | hook (PreModelSwitch). | Type: 'allow' | 'deny' | 'ask'. Optional. |
permission | Documented: An official docs page names this item. | hook (PreModelSwitch). | Type: string. Optional. |
decision | Documented: An official docs page names this item. | hook (PermissionRequest). | Type: Permission. Optional. |
updated | Documented: An official docs page names this item. | hook (PostToolUse): replaces what the model sees of the result of the tool. | Type: unknown. Optional. |
updated | Documented: An official docs page names this item. | hook (PostToolUse, MCP tools only). | Type: unknown. Optional. |
retry | Documented: An official docs page names this item. | hook (PermissionDenied). | Type: true. Optional. |
display | Documented: An official docs page names this item. | hook (MessageDisplay). | Type: string. Optional. |
worktree | Documented: An official docs page names this item. | hook (WorktreeCreate, a command hook prints it): the worktree that the hook created, absolute or relative to its cwd. | Type: string. Optional. If unset, the session creates its git worktree as it would unhooked. |
ClassicResultFields
The event-specific fields of ClassicResult that each classic event reads (its hookSpecificOutput), by event. An event absent here reads none of them. Every event has block, preventContinuation and stopReason.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
User | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
User | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
Session | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
Setup | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
Pre | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'permission. |
Post | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
Subagent | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
Post | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
Post | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
Post | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
Stop | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
Subagent | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'additional. |
Permission | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'retry'. |
Permission | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'decision'. |
Message | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'display. |
Worktree | Documented: An official docs page names this item. | The result fields of classic., besides the block, prevent, and stop that every event has. | Type: 'worktree. |
ClassicResultOf
What the hook of each classic hook event returns and its next(e) resolves to: the own subset of ClassicResult for the event. [E in ClassicHookEvent as classic.${E}] ``. classic.PreToolUse keeps its allow / ask / deny result (PreToolUseResult).
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
[E in Classic | Documented: An official docs page names this item. | The result of each classic. event: Pre for classic., a pick of Classic fields for the rest. | Type: E extends 'Pre. |
ConfigChangeHookInput
Combines ConfigChangeHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Config. | Type: 'Config. |
source | Documented: An official docs page names this item. | Which settings source changed. | Type: 'user_. |
file_ | Documented: An official docs page names this item. | The settings file that changed. | Type: string. Optional. |
CwdChangedHookInput
Combines CwdChangedHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Cwd. | Type: 'Cwd. |
old_ | Documented: An official docs page names this item. | The working directory before the change. | Type: string. |
new_ | Documented: An official docs page names this item. | The working directory after the change. | Type: string. |
DirectoryAddedHookInput
Combines DirectoryAddedHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Directory. | Type: 'Directory. |
directory | Documented: An official docs page names this item. | Absolute path of the directory that was added. | Type: string. |
source | Documented: An official docs page names this item. | How the directory was added: "slash_command" for /add-dir, "register_repo_root" for the SDK control_request. | Type: 'slash_. |
ElicitationHookInput
Hook input for the Elicitation event. Fired when an MCP server requests user input. Hooks can auto-respond (accept/decline) instead of displaying the dialog. Combines ElicitationHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Elicitation. | Type: 'Elicitation'. |
mcp_ | Documented: An official docs page names this item. | The name of the MCP server that asks for input. | Type: string. |
message | Documented: An official docs page names this item. | The text that the MCP server displays to ask for input. | Type: string. |
mode | Documented: An official docs page names this item. | Whether the MCP server asks with a form or with a url. | Type: 'form' | 'url'. Optional. |
url | Documented: An official docs page names this item. | The URL to open, in url mode. | Type: string. Optional. |
elicitation_ | Documented: An official docs page names this item. | The ID of the request. | Type: string. Optional. |
requested_ | Documented: An official docs page names this item. | The schema of the form the server asks for, in form mode. | Type: Record<string, unknown>. Optional. |
ElicitationResultHookInput
Hook input for the ElicitationResult event. Fired after the user responds to an MCP elicitation. Hooks can observe or override the response before the engine sends it to the server. Combines ElicitationResultHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Elicitation. | Type: 'Elicitation. |
mcp_ | Documented: An official docs page names this item. | The name of the MCP server that asked. | Type: string. |
elicitation_ | Documented: An official docs page names this item. | The ID of the request. | Type: string. Optional. |
mode | Documented: An official docs page names this item. | Whether the server asked with a form or with a url. | Type: 'form' | 'url'. Optional. |
action | Documented: An official docs page names this item. | The answer: accept, decline, or cancel. | Type: 'accept' | 'decline' | 'cancel'. |
content | Documented: An official docs page names this item. | The values submitted with the answer. | Type: Record<string, unknown>. Optional. |
FileChangedHookInput
Combines FileChangedHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always File. | Type: 'File. |
file_ | Documented: An official docs page names this item. | The path of the file that changed. | Type: string. |
event | Documented: An official docs page names this item. | What happened to the file: change, add, or unlink. | Type: 'change' | 'add' | 'unlink'. |
InstructionsLoadedHookInput
Combines InstructionsLoadedHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Instructions. | Type: 'Instructions. |
file_ | Documented: An official docs page names this item. | The path of the instructions file that was loaded. | Type: string. |
memory_ | Documented: An official docs page names this item. | The kind of memory file: User, Project, Local, or Managed. | Type: 'User' | 'Project' | 'Local' | 'Managed'. |
load_ | Documented: An official docs page names this item. | Why the file was loaded. This is the matcher. | Type: 'session_. |
globs | Documented: An official docs page names this item. | The path globs from the paths: frontmatter of the file. | Type: string[]. Optional. Present only when load_ is path_ (InstructionsLoaded input). |
trigger_ | Documented: An official docs page names this item. | The file whose access caused the load. | Type: string. Optional. |
parent_ | Documented: An official docs page names this item. | The file that includes this one. | Type: string. Optional. |
MessageDisplayHookInput
Hook input for the MessageDisplay event. Fired with each batch of newly completed lines while an assistant message streams. Display-only: the stored message and what the model sees are untouched. Combines MessageDisplayHookInput, BaseHookInput.
| Field | Status | What it is for | Type and limits |
|---|---|---|---|
hook_ | Documented: An official docs page names this item. | The event name: always Message. | Type: 'Message. |
turn_ | Documented: An official docs page names this item. | UUID of the current turn. | Type: string. |
message_ | Documented: An official docs page names this item. | UUID of the assistant message being displayed. Stable across every flush of the same message. Not the API msg_... id. | Type: string. |
index | Documented: An official docs page names this item. | Zero-based index of this delta within the message. Increments by one for each flush. | Type: number. |
final | Documented: An official docs page names this item. | True on the last flush of the message. Exactly one flush for each message has it. | Type: boolean. |
delta | Documented: An official docs page names this item. | The newly completed lines since the last flush. Always whole lines, except on the final flush. Treat final as the end-of-message signal. | Type: string. |