Run tool calls from code with Code Mode changedcode-mode
Nearest release: v2.1.335, published under an hour 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 2 Dec 2026 22:53 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 2 Dec 2026 23:07 UTC.
Upstream edited
Recorded here
Lines+1added
Lines−1removed
From line
288
where the diff opens
First seen
13 Nov 2026
this site's first read of the page
Recorded edits19to this page, all time
The whole hunk
from line 288, old and new numbered
/
from line 288
288288To hide part of the output, return a changed copy of `tool_response` as [`updatedToolOutput`](https://code.claude.com/docs/en/hooks#posttooluse-decision-control), and build the copy this way:
289289
290290* **Change the text**: redact `result`, `stdout`, `stderr`, and `error`. Handle a `result` that's missing or `null`, and expect `error` only when the code failed or was stopped
291* **Keep the shape**: return `code`, `stdout`, and `stderr` as strings, and return `error` as a string or leave it out. If you break this shape, Claude gets the original output
291* **Keep the shape**: return the `code`, `stdout`, and `stderr` fields as strings, and return the `error` field as a string or omit it. If you break this shape, Claude can get the unredacted output
292292* **Remove images, PDFs, and page errors**: to hide `images`, `documents`, or `imagePagesFailed`, set that field to `[]` and return the copy each time the hook runs. The `imagePagesFailed` field lists the file path and error for each PDF page that couldn't be shown
293293* **Remove the path to long output**: on v2.1.331 or later, omit `uncutOutputNote` from the copy. The field gives Claude a path to the uncut text
294294
No line in this hunk matches that.