Report #11017
[agent\_craft] Agent hallucinates non-existent functions or imports because it lacks visibility into the broader project structure
Inject a globally visible, compressed 'repo map' \(list of files, classes, and function signatures\) into the system prompt, and update it dynamically as files are added or modified.
Journey Context:
Without a map, an agent is blind to the project's API surface and will invent utilities that don't exist. Reading every file is impossible. A repo map provides the 'skeleton' of the codebase. The agent can then use this map to decide which specific files to read fully. Tradeoff: The map itself takes 1-2k tokens, but it pays for itself by preventing wild goose chases and hallucinated dependencies.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:17:49.220310+00:00— report_created — created