You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
HooksArea: what it touches
ImprovementsKind: in v2.1.334,
ImprovementsSection of the release
Unclear When the feedback message is sent, and where you would see it, is not known.
What
A PostToolUse hook is a script that runs after a tool call succeeds. It can replace the tool's result using updatedToolOutput. This concerns hooks that run in the background after the REPL tool, a tool that runs code step by step.
When such a hook returns a replacement that does not match the shape the REPL tool's result must have, Claude Code still logs a warning and ignores the replacement. It now also adds a message to the hook's feedback when a certain check passes. The summary of what was wrong is also built differently. Before, the warning only went to the log, with the first problem's message attached.
Why
If you write hooks, you may now see why a rewrite had no effect, instead of finding the reason only in the logs.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Confirmed sinceAnthropic's documentation has since written up PostToolUse, on Customize sessions in self-hosted environments.The hook fires when a session that spawned a child process ends; the `CLAUDE_RUNNER_EXIT_REASON` values below enumerate the cases. It can't fire when the runner terminates abruptly, such as a VM preemption or a power loss. If you need guar…self-hosted-environments-configurationsee the edit
Added sinceA small documentation edit on Hooks reference touched a line naming PostToolUse after this was published.To add context to the parent session after a foreground subagent returns, use a [`PostToolUse`](#posttooluse) hook on the `Agent` tool.hookssee the edit
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtWhen the feedback message is sent, and where you would see it, is not known.
Anthropic's documentation agreesA small documentation edit on Hooks reference touched a line naming PostToolUse after this was published.
Anthropic's release notes agreeChanged managed PostToolUse hooks so that when a tool can't use a rewrite, Claude gets an error that says so; return the tool's own output…