Loading patterns…
Filesystem as Context (Context Offloading)(FSC)
Treat the agent's own file tools plus the operating-system filesystem as unbounded, persistent, agent-operable external memory. Token-heavy tool outputs such as search results, page dumps, and large files are written to disk and replaced in the message history by a short reference (a path plus a one-line summary); the agent re-reads or greps the file on demand. This keeps the live context window small and the KV-cache prefix stable while preserving full recoverability, unlike lossy summarization. Distinct from `context-write-patterns` (which teaches memory abstractions like buffers and vector stores rather than the agent reading and writing its own scratch files) and from `plan-todo-recitation`, which is only the todo.md-recitation slice of this larger idea.
In 30 seconds
- What
- Agent writes large tool outputs to disk files and replaces them in context with path plus one-line summary, re-reading on demand.
- When to use
- Multi-turn work with large search results, page dumps, or file payloads that would bloat the context window or destabilize the KV-cache.
- Watch out
- Filesystem storage is finite and requires management; agent must verify file existence and freshness before assuming cached references remain valid.
Ask the AI expert about this pattern
Opens the assistant with your question prefilled. You review it before sending.
Filesystem as Context (Context Offloading): Overview
Treat the agent's own file tools plus the operating-system filesystem as unbounded, persistent, agent-operable external memory. Token-heavy tool outputs such as search results, page dumps, and large files are written to disk and replaced in the message history by a short reference (a path plus a one-line summary); the agent re-reads or greps the file on demand. This keeps the live context window small and the KV-cache prefix stable while preserving full recoverability, unlike lossy summarization. Distinct from `context-write-patterns` (which teaches memory abstractions like buffers and vector stores rather than the agent reading and writing its own scratch files) and from `plan-todo-recitation`, which is only the todo.md-recitation slice of this larger idea.
- File tools (read, write, grep) used as the agent's external memory
- Large tool outputs written to disk, replaced by path plus short summary in context
- Re-read or grep on demand to recover the exact bytes when needed
- Stable KV-cache prefix because prior turns are not rewritten
- Lossless: the full payload stays retrievable, unlike summarization
- Persists across turns and sessions, unbounded by the context window
The Agent Architect
One pattern, one tradeoff, one production failure story. A short weekly briefing for people building agentic systems.
Weekly email, one-click unsubscribe. We only use your address to send the briefing.
References
The papers, specifications, and repositories this pattern is based on.
ReasoningLayer Box
Run these agents in your own office, with unlimited tokens.
The ReasoningLayer Box puts the models, the memory and your AI workers on a box at your place. Nothing leaves the building, nothing is metered, and there is no price per person. The design partner program is open by application: our lowest price and a direct say in the roadmap.
- No token meter, no credits
- Your data never leaves your building
- One box for a team of 10 to 20