October 2026

An agent's state lives on local disk

Notes from Anthropic's "Hosting the Agent SDK". The Agent SDK spawns a claude CLI subprocess that owns a shell, a working directory, and session files on disk. So hosting an agent isn't like hosting a stateless API wrapper. Every running agent is a long-lived process tied to local state.

State lives on local disk

By default, three kinds of agent state live on the container's filesystem:

None of them survive a container restart, a scale-down, or a move to another node. A SessionStore can persist transcripts, but it only covers transcripts. Memory files and artifacts need their own storage, such as a mounted volume or an object-store sync.

Four session patterns

Session lifecycle comes down to how long a container lives compared with the sessions it serves:

The takeaway for me: before I pick where an agent runs, I need to decide where its state lives. The session pattern follows from that.

To learn the vocabulary behind this (process, subprocess, cwd, sandbox-runtime, container, microVM) and see which layer stops which problem, try the interactive companion: Agent Isolation Layers.

← Back to all posts