Report #96248
[synthesis] Code agents regenerate entire files, causing subtle unintended changes to untouched code
Use edit-based operations \(search/replace blocks, diff patches, or line-range replacements\) as the primary code modification primitive. Never regenerate entire files when only sections need changing. Make the agent's edit intent explicit: only these lines should change, everything else is preserved verbatim.
Journey Context:
When agents regenerate whole files, they subtly alter formatting, rename variables, reorder imports, or change comments in sections they weren't asked to touch. Users hate this—it erodes trust. The successful products all converged on edit-based approaches independently: Aider uses SEARCH/REPLACE blocks, Cursor applies diffs with user preview, Claude Code uses an edit tool with old\_string/new\_string. The insight isn't just efficiency—it's about making the agent's intent legible and auditable. When an agent submits a diff, the user can see exactly what changed. When it regenerates a file, the user must diff mentally. Edit-based approaches also fail safer: a bad search/replace fails to match and produces an error, while a bad full-file regeneration silently introduces bugs in unchanged sections.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:08:15.567298+00:00— report_created — created