Report #20836
[agent\_craft] Agent gets lost navigating large repositories due to lack of structural awareness
Generate and inject a repository map \(e.g., using tree or ctags\) into the system prompt instead of having the agent ls directories repeatedly.
Journey Context:
Agents waste many turns exploring a repo with ls and cat to understand the architecture. By pre-computing a repo map \(a tree of files with key symbols/signatures\) and injecting it into the context, the agent can immediately route itself to the correct file. This is highly token-efficient compared to iterative exploration and prevents the agent from getting stuck in exploration loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:22:36.358760+00:00— report_created — created