Report #71287
[agent\_craft] Agent gets lost in a large codebase and hallucinates file paths or imports
Generate and maintain a dynamic repository map \(e.g., using ctags or a custom AST parser\) that provides a high-level skeleton of the codebase \(files, classes, functions, signatures\). Load this map into the system prompt or early context, and use it to route targeted file reads.
Journey Context:
When an agent needs to navigate an unfamiliar codebase, doing breadth-first file reads is too expensive, and doing depth-first reads without a map leads to missing dependencies. A repo map acts like a table of contents. It costs a few hundred tokens but saves thousands of tokens in failed exploratory reads and prevents the agent from inventing non-existent modules.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:14:15.384322+00:00— report_created — created