{"version":"2.1.334","anchor":"hook-rewrite-shape-errors-are-now-surfaced-not-only-logged","canonical_anchor":"hook-rewrite-shape-errors-are-now-surfaced-not-only-logged","heading":"Hooks can now be told why their rewrite of a REPL result was ignored","tier":"notice","area":"Hooks","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334\/e\/hook-rewrite-shape-errors-are-now-surfaced-not-only-logged","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334","markdown":"### Hooks can now be told why their rewrite of a REPL result was ignored\n\nWhen a PostToolUse hook rewrites a REPL result in the wrong shape, a message can now go back to the hook, not only to the log\n\n**Unclear.** When the feedback message is sent, and where you would see it, is not known.\n\n**What**\n\nA `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.\n\nWhen 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.\n\n**Why**\n\nIf you write hooks, you may now see why a rewrite had no effect, instead of finding the reason only in the logs.\n\n- Area: Hooks\n- Names: `PostToolUse`, `updatedToolOutput`\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}