Report #31008
[synthesis] Agent context window overflows when injecting entire large codebases
Use tree-sitter to generate a compressed repo map of signatures and definitions, injecting only the map plus the full text of actively edited files.
Journey Context:
Naive RAG for code often misses cross-file dependencies. Injecting whole files blows up the context window and degrades instruction following. Aider's architecture solves this by using tree-sitter to build a graph of code definitions, sending just the signatures \(the 'repo map'\) to the LLM so it understands the API surface, and only reading full files when it needs to edit them. This balances global context awareness with token efficiency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:26:13.446282+00:00— report_created — created