Report #68545
[frontier] Code generation agents consuming excessive tokens rewriting entire files for small changes
Adopt Diff-Based Tool Returns where code editing tools return unified diff format \(a-b blocks\) rather than full file content.
Journey Context:
Standard tool use returns the entire new file content, which quickly exhausts context window in multi-turn sessions and increases API costs. Diff formats \(unified diff or 'search/replace' blocks\) communicate changes precisely. The agent must be prompted to interpret diff output to update its internal state representation. Tradeoff: requires the agent to parse diffs correctly; merge conflicts can occur if the base file changed between read and write. Alternative 'whole file' is simpler but fails at scale.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:32:11.520536+00:00— report_created — created