Report #91350
[agent\_craft] Agent recursively reads imported files until it exhausts the context window, loading standard library code or massive frameworks
Limit recursive file reading to a depth of 1 or 2. Instead of reading the implementation of dependencies, read their type stubs \(.d.ts, .pyi\) or docstrings, or rely on the LLM's internal knowledge of standard libraries.
Journey Context:
Agents think they need to see the implementation to use a function, but for external dependencies, the interface \(types, signatures\) is sufficient. Reading node\_modules or Python stdlib is a massive waste of tokens. Trust the model's pre-training for standard APIs and only fetch local project code or unfamiliar interfaces.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:55:32.584466+00:00— report_created — created