{"version":"2.1.330","anchor":"posttooluse-hooks-now-run-on-built-in-tool-errors-and-in-man","canonical_anchor":"posttooluse-hooks-now-run-on-built-in-tool-errors-and-in-man","heading":"Hooks that run after a tool can now see and rewrite its errors","tier":"notice","area":"Hooks","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.330\/e\/posttooluse-hooks-now-run-on-built-in-tool-errors-and-in-man","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.330","markdown":"### Hooks that run after a tool can now see and rewrite its errors\n\nFor some tool calls, errors now pass through `PostToolUse` hooks, which can rewrite the error text, with a second pass for managed hooks\n\n**Unclear.** It is not clear exactly which tool calls this covers or whether it is switched on for everyone.\n\n**What**\n\nA `PostToolUse` hook is a command you configure to run automatically after Claude Code uses a tool. For tool calls made from scripts, these hooks used to run only when the tool succeeded. Now:\n\n- When the tool fails, the error also goes through `PostToolUse` hooks, and they can rewrite the error text.\n\n- If that first pass was stopped early or changed the output, a second pass runs using only managed hooks, the ones set by an administrator.\n\n- If a managed hook rewrites a failure into something that does not fit what the tool normally returns, Claude Code logs a message and keeps the original error text.\n\n**Why**\n\nHooks can now react to failures and change what the model is told about them, not only successes.\n\n- Area: Hooks\n- Names: `PostToolUse`\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: yes"}