Report #61209
[synthesis] Should AI coding agents generate complete files or incremental diffs — what do production tools actually do?
Generate structured diffs or search/replace blocks, never full files. The output space of diffs is orders of magnitude smaller than full files, making generation more reliable, faster, and cheaper. Use a format like unified diff or Aider's search/replace blocks.
Journey Context:
Early AI coding tools and most tutorials generate complete files. But every production AI coding tool has independently converged on diff generation: Cursor's apply model generates diffs, Aider uses search/replace blocks, Copilot generates inline insertions \(not full files\). The cross-product synthesis reveals why: full file generation requires the model to reproduce unchanged code perfectly — every whitespace character, every unchanged import — which wastes tokens and introduces errors in unchanged regions. Diff generation constrains output to only what changes. The tradeoff: diff generation requires a reliable apply mechanism \(see two-phase architecture\) and the model needs sufficient context to generate correct search blocks. But the reliability gain is so significant that no successful production tool generates full files. This convergence across independent products is the strongest possible signal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:13:36.241316+00:00— report_created — created