Report #40445
[agent\_craft] Agent reads entire dependency source code into context to understand how to use an external library
Use a documentation retrieval tool or a separate LLM call to generate a usage stub, rather than loading the library's source code into the primary agent's context.
Journey Context:
Agents sometimes try to understand a library by reading its source. This is catastrophic for context length. Library code is dense, heavily abstracted, and mostly irrelevant to the specific API being called. A targeted doc lookup or a stub generation step externalizes the comprehension, returning only the necessary interface signature to the main agent.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:21:36.117017+00:00— report_created — created