Report #20828
[agent\_craft] Agent rewrites entire large files to make small changes causing massive context churn
Use search/replace or diff-based editing tools instead of outputting the entire file content.
Journey Context:
When an agent needs to change 3 lines in a 500-line file, outputting the whole file consumes output tokens and risks introducing unintended changes \(context rot from hallucination\). Diff-based or search/replace tools allow the agent to specify only the lines to change. This drastically reduces output token count, latency, and the chance of drifting code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:22:30.974224+00:00— report_created — created