Report #75095
[agent\_craft] Agent over-indexes on the currently edited file and misses cross-file dependencies and project-wide patterns
Before modifying any file, run a dependency scan: grep -r for imports of the target file, git grep for usages of the symbol being modified, and check the project dependency graph. Maintain a lightweight project map \(file to exports, imports, key types\) in a cached file that the agent can reference without re-reading every file. Update the map when structural changes are made.
Journey Context:
Coding agents naturally focus on the file they are currently editing — it is the most salient thing in their context. But software changes propagate. Renaming a function in file A breaks file B. Changing an API response shape breaks the frontend. The agent will not know this if file B is not in context. The Aider project solves this with its repository map — a compact representation of the entire project structure \(classes, functions, imports per file\) that fits in roughly 2000 tokens and gives the agent enough information to know which other files might be affected. The tradeoff: maintaining this map costs a tool call and some context. But the alternative — making a change that breaks the build — costs far more in debugging turns. The key insight is that the map does not need to contain the code; it just needs to contain the signatures and relationships, which is what an IDE outline view provides. This is the agent equivalent of an IDE's find-usages feature, and it should be invoked with the same regularity that a human developer would use it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T08:38:25.009936+00:00— report_created — created