Report #62933
[agent\_craft] Agent loads entire codebase files into context to 'understand' the project, causing immediate context overflow
Implement a two-step retrieval pipeline: 1\) A fast, index-based search \(e.g., embeddings, keyword\) to identify candidate files/snippets, 2\) A targeted load of only the top-K relevant chunks into the agent's working context.
Journey Context:
A common anti-pattern is for an agent to run 'find . -name \*.py' and then try to read the top 20 files. This wastes thousands of tokens on boilerplate and irrelevant logic. By routing through a retriever first, the agent only pays the context cost for what is actually relevant to the query. The tradeoff is that the retriever might miss a crucial file \(recall error\), so the agent must have the ability to dynamically expand its search if the retrieved context is insufficient to answer the query.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T12:07:07.001407+00:00— report_created — created