The Virtual Filesystem
How a deep agent offloads big results and notes to a virtual filesystem so long tasks don't overflow the prompt — and cost less. Explained with examples.
By the ToolsHub team · Updated September 14, 2026
Even a 1M-token context window fills up on a real task — a dozen web pages, a long transcript, code files. Stuffing all of it into the prompt is slow, expensive, and eventually impossible. A deep agent solves this with a virtual filesystem: it writes big results to files and reads them back only when needed, keeping the live prompt small.
It's built in
In deepagents the filesystem tools are on by default — the agent gets tools to write, read and list files, and it uses them to stash intermediate work. You don't configure anything to start; you just prompt the agent to save findings to files and summarise from them.
Why it matters for cost and reliability
- Cost — you pay per token every turn. Offloading a 50-page document to a file and re-reading only the relevant part keeps each request small. Estimate the difference with the token calculator.
- Reliability — a smaller, focused context means fewer distractions and better answers on long runs.
- Persistence — artifacts survive across steps (and, with long-term memory, across runs), so the agent can resume where it left off.
Think of it as the agent's scratch disk: the prompt is RAM, the filesystem is storage.