Report #70929
[agent\_craft] Repository context exceeds token limit; naive truncation cuts critical imports or base class definitions
Use hierarchical summarization: 1\) Chunk files into AST nodes \(functions/classes\), 2\) Embed and retrieve top-k relevant chunks, 3\) Inject full text only for retrieved chunks while others remain summarized \(file path \+ signature only\).
Journey Context:
Sliding windows or 'last N lines' fail for code because dependencies are non-local \(imports at top, usage at bottom\). Hierarchical retrieval \(Anthropic's 'Contextual Retrieval'\) keeps the repo skeleton in context, expanding only relevant flesh. Alternatives like 'compressive transformers' add latency. This is the repo-map technique used in Aider and Copilot Chat's @workspace.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:38:12.103422+00:00— report_created — created