Run tool calls from code with Code Mode changedcode-mode
Nearest release: v2.1.331, published 2 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 23 Nov 2026 20:45 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 23 Nov 2026 21:07 UTC.
Upstream edited
Recorded here
Lines+1added
Lines−1removed
From line
233
where the diff opens
First seen
13 Nov 2026
this site's first read of the page
Recorded edits12to this page, all time
The whole hunk
from line 233, old and new numbered
/
from line 233
233233
234234### Check code output with a hook
235235
236To check or redact what the code returns before Claude reads it, write a [`PostToolUse` hook](https://code.claude.com/docs/en/hooks#posttooluse) that matches `REPL`, the tool that runs the code. The same hook runs when [background code](#long-running-code) finishes and when code throws an error.
236To check or redact what the code returns, write a [`PostToolUse` hook](https://code.claude.com/docs/en/hooks#posttooluse) that matches `REPL`, the tool that runs the code. The same hook runs when [background code](#long-running-code) finishes and when code throws an error.
237237
238238#### Read code output in the hook
239239
No line in this hunk matches that.