Follow Discord
Sweep 03 Dec 2026 · 19:13Z Build v2.1.336 553 read Stable v2.1.332 Latest v2.1.336 Next v2.1.336 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.334 ·

Hooks that rewrite a tool result in the wrong shape now get an error

A PostToolUse hook whose updatedToolOutput doesn't match the tool's output shape is now reported as a hook error that does not stop work

You'll notice Improvements
JSON All of v2.1.334
You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
1Signal: worth watching, 1 to 5
HooksArea: what it touches
ImprovementsKind: in v2.1.334,
ImprovementsSection of the release
What

A PostToolUse hook runs after a tool call succeeds, and can rewrite the tool's result with updatedToolOutput. Each tool's result has an expected shape, meaning the fields and types it is made of. If a hook's updatedToolOutput does not match that shape, Claude Code now reports it as a hook error. The error is non-blocking, so the session carries on.

Why

If you write hooks, you now find out when your rewrite was not used, instead of it being dropped without a word.

Read from
Names in the bundlePostToolUseupdatedToolOutput
Since it was published

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 since Anthropic'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-configuration see the edit
Added since A 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. hooks see the edit
How sure we are
Two sources agreeTwo things we can check say the same as this entry.
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…

See this entry in the whole of v2.1.334 →

Feedback