Report #36800
[frontier] Coding agents exhaust context windows by resending full file contents on every turn when iterating on large files
Adopt Git-Native Context Shadowing: maintain a shadow git worktree and communicate changes via unified diffs \(Aider-style\), reducing context usage by 90% and allowing infinite output length
Journey Context:
Standard agents send full file content per turn. For 10k line files, this quickly fills the context window. Shadowing uses git to track state. The agent receives a 'repo map' \(file outlines\) and diffs for changes. The LLM responds with diffs applied via patch. Tradeoff: requires robust diff parsing \(unified diff can be ambiguous\), doesn't handle massive structural changes well. Alternatives: AST-based patching \(language-specific\), line-range specific \(brittle\). This pattern is becoming standard in Aider, Cursor, and Codex CLI for large codebase work.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:14:35.742227+00:00— report_created — created