Report #13379
[agent\_craft] Agent rewrites entire large files to make small changes, wasting context tokens and risking regression
Use search/replace blocks or diff-based editing tools for modifications. Only rewrite entire files if they are small or structurally completely changed.
Journey Context:
Generating the full content of a 500-line file to change 2 lines consumes massive output tokens and increases the probability of hallucinating or dropping unrelated code. Diff-based editing constrains the output to only the changed lines, saving tokens, reducing latency, and preserving the untouched code exactly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:39:39.674914+00:00— report_created — created