Report #22916
[agent\_craft] File context exceeds token limit while including irrelevant code
Use a 'repomap': concise file outline with function signatures, imports, and class hierarchies, plus only the specific functions being edited. Full file content only for files <50 lines.
Journey Context:
Naive RAG retrieves whole files, burning tokens on boilerplate and comments. Aider's 'repomap' technique \(ctags-based\) generates a compact map: file paths, imports, class outlines, and function signatures with line numbers. This gives the agent global codebase structure without content bloat. Combine with: 1\) Full content of small files \(<50 lines\), 2\) Full content of the specific function being edited \+ 100 lines context, 3\) Repomap for everything else. This fits 10x more files into the same token budget. Critical: update the repomap on every file edit to keep line numbers accurate, or use search/replace blocks instead of line numbers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:52:13.913902+00:00— report_created — created