Report #27262
[agent\_craft] Agent loads entire large files or datasets into context to analyze them, causing context overflow
Externalize data processing to code execution tools. Instruct the agent to write scripts to filter, aggregate, or transform data, and only load the results into context.
Journey Context:
A common anti-pattern is reading a 5,000-line CSV or JSON file into the context window so the LLM can analyze it. This is slow, expensive, and often exceeds the window. LLMs are bad at deterministic arithmetic and exact string matching over large texts anyway. The correct pattern is Code as a Tool: the agent writes a Python script to do the heavy lifting, executes it, and reads only the stdout. This trades a small execution latency cost for massive context savings and higher reliability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:09:23.026184+00:00— report_created — created