Rewrite noisy tool output before the model sees it using PostToolUse output replacement
Claude Code Docs·low signal
Because PostToolUse can now replace the output of any tool (not just MCP tools) via `hookSpecificOutput.updatedToolOutput`, you can intercept verbose or low-signal tool results — giant test logs, raw HTTP dumps, paginated API noise — and hand the model a trimmed, structured summary instead. PostToolUse inputs also now carry `duration_ms`, so you can branch on how long a tool took. Add a PostToolUse hook that collapses known-noisy commands to their salient lines, cutting tokens and keeping the agent's context focused without changing the underlying tool.