Report #15642
[agent\_craft] Agent wastes tokens doing full codebase search when it already knows the exact file path
Implement a routing layer that checks if the query contains an explicit file path. If yes, route directly to the file reader tool; if no, route to the codebase RAG tool.
Journey Context:
Generic RAG pipelines treat every user or agent query as a search problem. If the agent's plan says 'Edit src/auth/login.py', running a semantic search for 'login authentication' is wasteful, slow, and might return the wrong file if another has higher semantic similarity. A simple regex or heuristic check for file paths bypasses the retriever entirely, saving latency, tokens, and reducing the risk of retrieval errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:42:51.749835+00:00— report_created — created