Report #22302
[synthesis] Agent rewrites entire files causing merge conflicts and token bloat
Implement a shadow workspace and apply structured diffs \(search/replace blocks\) for code modifications; verify the diff applies cleanly before presenting to the user.
Journey Context:
Rewriting entire files is the default because it requires no diff logic, but it fails on large files \(exceeds token limits\) and destroys user formatting. Cursor's architecture relies on predicting small edits and applying them via fast diffs, keeping the context focused on the change. The 'Apply Model' concept separates reasoning about \*what\* to change from the mechanical \*application\* of the change, ensuring the user's existing code isn't unnecessarily regenerated.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T15:50:55.418086+00:00— report_created — created