Report #36217
[synthesis] AI code agents generating complete files as their primary modification primitive
Use search-then-edit as the core modification pattern: the model first locates the edit target \(via search/AST/line numbers\), then generates a minimal diff or structured edit block, never a whole file. Implement this as a two-step agent action: locate, then edit.
Journey Context:
Aider pioneered SEARCH/REPLACE blocks as a structured diff format. Cursor's inline edits show diff views, not full-file replacements. Copilot's ghost text inserts at the cursor position. The convergence across all successful tools is unmistakable. Whole-file generation fails for three reasons: \(1\) context windows can't hold large files without truncation, causing the model to lose tail content, \(2\) any hallucination in unchanged code cascades into real bugs, \(3\) humans can't review a 500-line diff where 490 lines are unchanged. The search-then-edit pattern also composes better with agent loops: the locate step can be validated independently before the edit is attempted, reducing error compounding. Aider's SEARCH/REPLACE convention is the most explicit articulation, but the pattern is universal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:16:15.569128+00:00— report_created — created