Skip to main content

Classic Permission, Compact, and Tool Batch Types

Types with Fields​

Each type below has its own table of fields.

NotificationHookInput​

Combines NotificationHookInput, BaseHookInput.

FieldStatusWhat it is forType and limits
hook_event_name
Documented: An official docs page names this item.
The event name: always Notification.Type: 'Notification'.
message
Documented: An official docs page names this item.
The notification text.Type: string.
title
Documented: An official docs page names this item.
The notification title.Type: string. Optional.
notification_type
Documented: An official docs page names this item.
The kind of notification, such as idle_prompt.Type: string.

PermissionDeniedHookInput​

Combines PermissionDeniedHookInput, BaseHookInput.

FieldStatusWhat it is forType and limits
hook_event_name
Documented: An official docs page names this item.
The event name: always PermissionDenied.Type: 'PermissionDenied'.
tool_name
Documented: An official docs page names this item.
The name of the tool.Type: string.
tool_input
Documented: An official docs page names this item.
The arguments the tool was called with.Type: unknown.
tool_use_id
Documented: An official docs page names this item.
The ID of the tool call.Type: string.
reason
Documented: An official docs page names this item.
Why the call was denied.Type: string.
mcp_server
Documented: An official docs page names this item.
The MCP server the tool comes from, for an mcp__* tool.Type: McpServerProvenance. Optional.

PermissionRequestDecision​

The decision of a classic.PermissionRequest answer, as the hookSpecificOutput.decision of the classic hook: allow (with a rewrite or rules) or deny.

FieldStatusWhat it is forType and limits
behavior
Documented: An official docs page names this item.
Allows the request: allow.Type: 'allow'.
updatedInput
Documented: An official docs page names this item.
Replaces the tool input before the tool runs.Type: Record<string, unknown>. Optional.
updatedPermissions
Documented: An official docs page names this item.
Permission updates to apply with the decision.Type: PermissionUpdates. Optional.
behavior
Documented: An official docs page names this item.
Denies the request: deny.Type: 'deny'.
message
Documented: An official docs page names this item.
Tells Claude why the request was denied.Type: string. Optional.
interrupt
Documented: An official docs page names this item.
true stops Claude after the denial.Type: true. Optional.

PermissionRequestHookInput​

Combines PermissionRequestHookInput, BaseHookInput.

FieldStatusWhat it is forType and limits
hook_event_name
Documented: An official docs page names this item.
The event name: always PermissionRequest.Type: 'PermissionRequest'.
tool_name
Documented: An official docs page names this item.
The name of the tool.Type: string.
tool_input
Documented: An official docs page names this item.
The arguments the tool was called with.Type: unknown.
permission_suggestions
Documented: An official docs page names this item.
The permission updates Claude Code suggests for this request, such as adding an allow rule or changing the permission mode.Type: PermissionUpdate[]. Optional. Not an exact list of the dialog choices (PermissionRequest input).
mcp_server
Documented: An official docs page names this item.
The MCP server the tool comes from, for an mcp__* tool.Type: McpServerProvenance. Optional.

PermissionRuleValue​

FieldStatusWhat it is forType and limits
toolName
Documented: An official docs page names this item.
The tool the rule is for.Type: string.
ruleContent
Documented: An official docs page names this item.
The part of the rule inside the parentheses. If absent, the rule covers the whole tool.Type: string. Optional.

PermissionUpdate​

FieldStatusWhat it is forType and limits
type
Documented: An official docs page names this item.
The kind of update: addRules.Type: 'addRules'.
rules
Documented: An official docs page names this item.
The rules to add.Type: PermissionRuleValue[].
behavior
Documented: An official docs page names this item.
What the rules do: allow, deny, or ask.Type: PermissionBehavior.
destination
Documented: An official docs page names this item.
Where the update is saved.Type: PermissionUpdateDestination.
type
Documented: An official docs page names this item.
The kind of update: replaceRules.Type: 'replaceRules'.
rules
Documented: An official docs page names this item.
The rules that replace the existing ones.Type: PermissionRuleValue[].
behavior
Documented: An official docs page names this item.
What the rules do: allow, deny, or ask.Type: PermissionBehavior.
destination
Documented: An official docs page names this item.
Where the update is saved.Type: PermissionUpdateDestination.
type
Documented: An official docs page names this item.
The kind of update: removeRules.Type: 'removeRules'.
rules
Documented: An official docs page names this item.
The rules to remove.Type: PermissionRuleValue[].
behavior
Documented: An official docs page names this item.
What the rules do: allow, deny, or ask.Type: PermissionBehavior.
destination
Documented: An official docs page names this item.
Where the update is saved.Type: PermissionUpdateDestination.
type
Documented: An official docs page names this item.
The kind of update: setMode.Type: 'setMode'.
mode
Documented: An official docs page names this item.
The permission mode to set.Type: PermissionMode.
destination
Documented: An official docs page names this item.
Where the update is saved.Type: PermissionUpdateDestination.
type
Documented: An official docs page names this item.
The kind of update: addDirectories.Type: 'addDirectories'.
directories
Documented: An official docs page names this item.
The directories to add.Type: string[].
destination
Documented: An official docs page names this item.
Where the update is saved.Type: PermissionUpdateDestination.
type
Documented: An official docs page names this item.
The kind of update: removeDirectories.Type: 'removeDirectories'.
directories
Documented: An official docs page names this item.
The directories to remove.Type: string[].
destination
Documented: An official docs page names this item.
Where the update is saved.Type: PermissionUpdateDestination.

PostCompactHookInput​

Combines PostCompactHookInput, BaseHookInput.

FieldStatusWhat it is forType and limits
hook_event_name
Documented: An official docs page names this item.
The event name: always PostCompact.Type: 'PostCompact'.
trigger
Documented: An official docs page names this item.
What started the compaction: manual or auto.Type: 'manual' | 'auto'.
compact_summary
Documented: An official docs page names this item.
The conversation summary produced by compactionType: string.

PostModelSwitchHookInput​

Combines PostModelSwitchHookInput, BaseHookInput.

FieldStatusWhat it is forType and limits
hook_event_name
Documented: An official docs page names this item.
The event name: always PostModelSwitch.Type: 'PostModelSwitch'.
from_model
Documented: An official docs page names this item.
Resolved model id the session was running before the switchType: string.
to_model
Documented: An official docs page names this item.
Resolved model id the session runs after the switchType: string.
requested_model
Documented: An official docs page names this item.
What was asked for (alias such as "opus", a full id, or null for "default")Type: string | null.
source
Documented: An official docs page names this item.
Why the model changed: command (/model or the /config Model row), picker, sdk (headless set_model), auto (fallback or other change), or resume.Type: 'command' | 'picker' | 'sdk' | 'auto' | 'resume'.
context_tokens
Documented: An official docs page names this item.
Prompt tokens that the next request re-sends: the input, cache read, cache creation, and output tokens of the last main-thread response. 0 before the first response.Type: number.
prompt_cache_warm
Documented: An official docs page names this item.
Whether the prompt cache of the current model is likely still warm (a switch then forfeits it)Type: boolean.
cache_ttl
Documented: An official docs page names this item.
How long the prompt cache lasts: 5m or 1h.Type: '5m' | '1h'.
estimated_cache_write_usd
Documented: An official docs page names this item.
Estimated cost of re-caching context_tokens on to_model at its cache-write rate. It uses the managed modelPricing when set, otherwise list price. It excludes the responseType: number.
pricing
Documented: An official docs page names this item.
configured: priced at the managed modelPricing setting. catalog: list price. default: to_model unknown, so the default tier was assumedType: 'configured' | 'catalog' | 'default'.

PostToolBatchHookInput​

Hook input for PostToolBatch. Fires once after every tool call in a batch resolved, before the next model request. PostToolUse fires for each tool. Combines PostToolBatchHookInput, BaseHookInput.

FieldStatusWhat it is forType and limits
hook_event_name
Documented: An official docs page names this item.
The event name: always PostToolBatch.Type: 'PostToolBatch'.
tool_calls
Documented: An official docs page names this item.
The tool calls of the batch.Type: PostToolBatchToolCall[].

PostToolBatchToolCall​

FieldStatusWhat it is forType and limits
tool_name
Documented: An official docs page names this item.
The name of the tool.Type: string.
tool_input
Documented: An official docs page names this item.
The arguments the tool was called with.Type: unknown.
tool_use_id
Documented: An official docs page names this item.
The ID of the tool call.Type: string.
tool_response
Documented: An official docs page names this item.
What the tool returned.Type: unknown. Optional.

PostToolUseFailureHookInput​

Combines PostToolUseFailureHookInput, BaseHookInput.

FieldStatusWhat it is forType and limits
hook_event_name
Documented: An official docs page names this item.
The event name: always PostToolUseFailure.Type: 'PostToolUseFailure'.
tool_name
Documented: An official docs page names this item.
The name of the tool.Type: string.
tool_input
Documented: An official docs page names this item.
The arguments the tool was called with.Type: unknown.
tool_use_id
Documented: An official docs page names this item.
The ID of the tool call.Type: string.
error
Documented: An official docs page names this item.
The error text of the failed call.Type: string.
is_interrupt
Documented: An official docs page names this item.
true when the failure was an abort, not an error the tool reported.Type: boolean. Optional.
duration_ms
Documented: An official docs page names this item.
Tool execution time in milliseconds. Excludes permission-prompt and hook time.Type: number. Optional.
mcp_server
Documented: An official docs page names this item.
The MCP server the tool comes from, for an mcp__* tool.Type: McpServerProvenance. Optional.

PostToolUseHookInput​

Combines PostToolUseHookInput, BaseHookInput.

FieldStatusWhat it is forType and limits
hook_event_name
Documented: An official docs page names this item.
The event name: always PostToolUse.Type: 'PostToolUse'.
tool_name
Documented: An official docs page names this item.
The name of the tool.Type: string.
tool_input
Documented: An official docs page names this item.
The arguments the tool was called with.Type: unknown.
tool_response
Documented: An official docs page names this item.
What the tool returned.Type: unknown.
tool_use_id
Documented: An official docs page names this item.
The ID of the tool call.Type: string.
duration_ms
Documented: An official docs page names this item.
Tool execution time in milliseconds. Excludes permission-prompt and hook time.Type: number. Optional.
mcp_server
Documented: An official docs page names this item.
The MCP server the tool comes from, for an mcp__* tool.Type: McpServerProvenance. Optional.

PreCompactHookInput​

Combines PreCompactHookInput, BaseHookInput.

FieldStatusWhat it is forType and limits
hook_event_name
Documented: An official docs page names this item.
The event name: always PreCompact.Type: 'PreCompact'.
trigger
Documented: An official docs page names this item.
What started the compaction: manual or auto.Type: 'manual' | 'auto'.
custom_instructions
Documented: An official docs page names this item.
The instructions given to /compact, or null when there are none.Type: string | null.

PreModelSwitchHookInput​

Combines PreModelSwitchHookInput, BaseHookInput.

FieldStatusWhat it is forType and limits
hook_event_name
Documented: An official docs page names this item.
The event name: always PreModelSwitch.Type: 'PreModelSwitch'.
from_model
Documented: An official docs page names this item.
Resolved model id the session was running before the switchType: string.
to_model
Documented: An official docs page names this item.
Resolved model id the session runs after the switchType: string.
requested_model
Documented: An official docs page names this item.
What was asked for (alias such as "opus", a full id, or null for "default")Type: string | null.
source
Documented: An official docs page names this item.
command: /model <name>, the /config Model row, or enabling fast mode when that promotes the model. picker: an interactive model picker. sdk: headless set_model (SDK, Remote Control, IDE)Type: 'command' | 'picker' | 'sdk'.
context_tokens
Documented: An official docs page names this item.
Prompt tokens that the next request re-sends: the input, cache read, cache creation, and output tokens of the last main-thread response. 0 before the first response.Type: number.
prompt_cache_warm
Documented: An official docs page names this item.
Whether the prompt cache of the current model is likely still warm (a switch then forfeits it)Type: boolean.
cache_ttl
Documented: An official docs page names this item.
How long the prompt cache lasts: 5m or 1h.Type: '5m' | '1h'.
estimated_cache_write_usd
Documented: An official docs page names this item.
Estimated cost of re-caching context_tokens on to_model at its cache-write rate. It uses the managed modelPricing when set, otherwise list price. It excludes the responseType: number.
pricing
Documented: An official docs page names this item.
configured: priced at the managed modelPricing setting. catalog: list price. default: to_model unknown, so the default tier was assumedType: 'configured' | 'catalog' | 'default'.