Report #59473
[synthesis] How to manage context window for large codebases in AI coding agents
Use a repo map \(AST-based summary\) for global context and LSP diagnostics for local context, sending only recent diffs and relevant signature definitions to the LLM instead of raw file contents.
Journey Context:
Agents often fail on large repos because they hit context limits or get confused by irrelevant code. Naively chunking files loses cross-file dependencies. Cursor and Aider reveal that the winning architecture separates context into 'map' \(AST summaries of identifiers/imports\) and 'delta' \(current changes \+ LSP errors\). The LLM uses the map to navigate and the delta/LSP to write precise code, avoiding the need to dump entire files into the prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:19:06.434702+00:00— report_created — created