Allow filtering Edit/Write tool responses to reduce context waste
Problem
Edit and Write tool responses echo the full file content back into the conversation context. In an audit of 1,060 tool calls across 8 sessions (3.2 MB total tool output), Edit alone accounted for 531K (16%) — nearly all redundant, since the model already knows what it wrote. Write adds another 52K. Combined, this is ~575K of pure waste (~17% of all tool output).
PostToolUse hooks cannot address this because updatedMCPToolOutput only works for MCP tools, not built-in tools. There is no hook mechanism to filter or replace built-in tool responses.
Proposed solutions (either would work)
- A setting/flag to disable the file echo in Edit/Write responses. For example,
"tools": { "Edit": { "echoContent": false } }in settings.json. The response would just confirm success (file path, lines changed) without returning the full content.
- Extend
updatedToolOutput(or equivalent) to built-in tools in PostToolUse hooks. This would let users write hooks that filter any tool's response before it enters context — solving Edit/Write and any future verbose built-ins.
Data
| Metric | Value |
|---|---|
| Edit calls measured | 61 |
| Edit avg response size | 8.7 KB |
| Edit calls >20 KB | 6 |
| Edit total output | 531 KB |
| Write total output | 52 KB |
| Combined waste | ~575 KB (17% of all tool output) |
Measured via PostToolUse hook logging tool_name + output size to CSV across 8 sessions on v2.1.87.
Why this matters
The model does not need the echo to verify its edit — it wrote the content. The echo consumes context window budget that would be better spent on actual work, and accelerates context compression in long sessions. This is the single largest source of avoidable context waste we've measured.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗