Hooks reference changedhooks
Nearest release: v2.1.284, published 7 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 29 Sep 2026 00:19 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 29 Sep 2026 00:37 UTC.
Upstream edited
Recorded here
Lines+6added
Lines−6removed
From line
590
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits63to this page, all time
The whole hunk
from line 590, old and new numbered
/
from line 590
590590| Field | Required | Description |
591591| :- | :- | :- |
592592| `prompt` | yes | Prompt text to send to the model. Use `$ARGUMENTS` as a placeholder for the hook input JSON. Escape with a backslash to include literal text: `\$1.00` renders as `$1.00` |
593| `model` | no | Model to use for evaluation. Defaults to a fast model |
593| `model` | no | Model to use for evaluation. Defaults to the model Claude Code uses for [background functionality](/docs/en/costs#background-token-usage) |
594594
595595### Reference scripts by path
596596
from line 1790
17901790| Field | Description |
17911791| :- | :- |
17921792| `permissionDecision` | `"allow"` skips the permission prompt, except for the [actions no mode auto-approves](/docs/en/permission-modes#actions-no-mode-auto-approves) and for `AskUserQuestion` and `ExitPlanMode`, which need [`updatedInput` paired with it](#allow-with-updatedinput). `"deny"` prevents the tool call. `"ask"` prompts the user to confirm. `"defer"` exits gracefully so the tool can be resumed later. [Deny and ask rules](/docs/en/permissions#manage-permissions) are still evaluated regardless of what the hook returns |
1793| `permissionDecisionReason` | For `"allow"` and `"ask"`, shown to the user but not Claude. For `"deny"`, shown to Claude. For `"defer"`, ignored |
1793| `permissionDecisionReason` | For `"ask"`, shown to the user but not Claude. For `"deny"`, shown to Claude. For `"allow"` and `"defer"`, written to the [debug log](#debug-hooks) only |
17941794| `updatedInput` | Modifies the tool's input parameters before execution. Replaces the entire input object, so include unchanged fields alongside modified ones. Claude Code evaluates permission rules and a Bash command's [auto-background eligibility](/docs/en/tools-reference#background-commands) against the input your hook returns, not the input Claude sent. Combine with `"allow"` to auto-approve, or `"ask"` to show the modified input to the user. For `"defer"`, ignored |
17951795| `additionalContext` | String added to Claude's context alongside the tool result. Ignored when `permissionDecision` is `"defer"`. See [Add context for Claude](#add-context-for-claude) |
17961796
from line 2155
21552155 "tool_name": "Read",
21562156 "tool_input": {"file_path": "/.../ledger/accounts.py"},
21572157 "tool_use_id": "toolu_01...",
2158 "tool_response": " 1\tfrom __future__ import annotations\n 2\t..."
2158 "tool_response": "1\tfrom __future__ import annotations\n2\t..."
21592159 },
21602160 {
21612161 "tool_name": "Read",
21622162 "tool_input": {"file_path": "/.../ledger/transactions.py"},
21632163 "tool_use_id": "toolu_02...",
2164 "tool_response": " 1\tfrom __future__ import annotations\n 2\t..."
2164 "tool_response": "1\tfrom __future__ import annotations\n2\t..."
21652165 }
21662166 ]
21672167}
from line 3511
35113511
35123512Instead of executing a Bash command, prompt-based hooks:
35133513
35141. Send the hook input and your prompt to a Claude model, Haiku by default
35141. Send the hook input and your prompt to a Claude model, by default the one Claude Code uses for [background functionality](/docs/en/costs#background-token-usage)
351535152. The LLM responds with structured JSON containing a decision
351635163. Claude Code processes the decision automatically
35173517
from line 3542
35423542| :- | :- | :- |
35433543| `type` | yes | Must be `"prompt"` |
35443544| `prompt` | yes | The prompt text to send to the LLM. Use `$ARGUMENTS` as a placeholder for the hook input JSON. If `$ARGUMENTS` is not present, input JSON is appended to the prompt |
3545| `model` | no | Model to use for evaluation. Defaults to a fast model |
3545| `model` | no | Model to use for evaluation. Defaults to the model Claude Code uses for [background functionality](/docs/en/costs#background-token-usage) |
35463546| `timeout` | no | Timeout in seconds. Default: 30 |
35473547| `continueOnBlock` | no | On the events it applies to, `true` feeds an `ok: false` reason back to Claude and continues instead of ending the turn. Default: `false`. See [Response schema](#response-schema) for per-event behavior |
35483548
No line in this hunk matches that.