Report #17567
[agent\_craft] Agent rewrites entire large files to make small changes, causing massive context diffs and high token usage
Implement and enforce diff-based or search-and-replace editing tools rather than full-file rewrite tools for files over a certain size.
Journey Context:
If an agent has to change one line in a 1000-line file, rewriting the whole file requires generating 1000 lines of output \(expensive and slow\) and makes it hard for the user to review the actual change. Diff-based tools \(like Aider's SEARCH/REPLACE blocks or standard patch\) force the agent to output only the changes. This drastically reduces output token cost, minimizes the chance of the agent accidentally altering other code, and makes the context history much more compact.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:46:49.999899+00:00— report_created — created