Report #82663
[agent\_craft] Agent loads massive files into context to analyze them, blowing up token limits
Write a Python script to process the large file, execute it, and only load the script's standard output into the context. Never load raw large data into the prompt.
Journey Context:
Agents often try to 'read' a file to understand it, but for data > few hundred lines, this consumes the entire context window and degrades reasoning. Externalizing computation to a sandboxed interpreter is cheaper, more reliable, and preserves context for reasoning. Code is a better context manager than the LLM's attention mechanism for large data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:20:30.600765+00:00— report_created — created