Report #91958
[agent\_craft] Loading entire large files into context to understand dynamic behavior
Externalize behavior discovery to code execution \(e.g., running unit tests with coverage, or executing a script to print state\) rather than loading massive files into the context window.
Journey Context:
A common anti-pattern is an agent reading a 2000-line file into context just to find out how one function behaves or what a variable evaluates to. This wastes tokens and dilutes focus. It is far more efficient to write a small test or print statement, execute it in a sandbox, and read the 5-line output. The tradeoff is the latency of tool execution vs the cost of context window real estate. Execution is almost always cheaper for dynamic behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:56:37.800258+00:00— report_created — created