Report #90219
[agent\_craft] Agent exhausts context window on long files before seeing relevant code sections
Use line-range sliding windows with overlap rather than full file inclusion; prioritize function signatures and docstrings over implementation bodies; compress imported modules to just their exported interface definitions.
Journey Context:
Naive RAG retrieves whole files, but a 500-line utility file can consume 4k\+ tokens. The efficient approach: \(1\) Parse the AST to extract function signatures and docstrings \(high signal, low token count\), \(2\) Include full body only for functions directly referenced in the task, \(3\) For dependencies, use stub files \(interface definitions\) rather than full source. This maintains semantic coverage while fitting 10x more files in context. The ctags approach used by Aider creates a 'repository map' that fits in ~2k tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:01:42.610172+00:00— report_created — created