Spill Giant Tool Results to Disk and Keep Only a Pointer in Context

30-60% on long agent runs with a few huge tool outputs Advanced 4 min read

One oversized tool result — a 40K-token API dump, a whole log file, a giant HTML page — gets re-sent on every subsequent turn of an agent loop. Write it to the filesystem instead and leave only a file path plus a short preview in context; let the agent re-read the full payload only if it actually needs it.

🔒 Pro tip · Advanced

Unlock this tip — and 111 more

This is one of 112 advanced, fact-checked tactics reserved for Pro. Get the full 134-tip library, a searchable archive, and a new tip every morning. Free for 7 days, then $9/mo.

Prefer to browse? The 22 Beginner tips are free forever.