Why persistence matters
Agents need to remember context across conversations:- A code review agent writes notes to
findings.mdand references them in later turns - A research agent saves scraped data to CSV files and analyzes it over multiple messages
- A dev agent clones a repo, makes changes, tests them, and iterates based on results
The /workspace filesystem
Superserve persists the /workspace directory across:
- Turns: Each message in a conversation
- Restarts: If the agent crashes or times out
- Sessions: Resume a conversation days later with every file intact
Only
/workspace persists. Everything else - system files, installed packages, process state - is ephemeral and resets when the session ends.How it works
When you start or resume a session:- Superserve spawns a fresh Firecracker microVM (see Isolation)
- The platform mounts the
/workspacefilesystem specific to that session - Your agent sees all files from previous turns exactly as it left them
- When the session ends, changes are synced back to persistent storage
What persists
Files created by the agent
Files created by the agent
Any file the agent writes to This includes:
/workspace is saved:- Text files, CSVs, JSON, databases
- Git repositories cloned or modified by the agent
- Build artifacts, test results, logs
- Any output from tools the agent runs
Project files from deployment
Project files from deployment
When you Inside the microVM:Your agent can read these files using relative paths:If the agent modifies these files during a session, the changes persist.
superserve deploy, your entire project directory (minus ignored files) is uploaded and extracted into /workspace.Conversation history (framework-dependent)
Conversation history (framework-dependent)
Most agent frameworks store conversation history in memory or on disk. If your framework supports persistent conversations, combine it with The SDK keeps the conversation in memory during the session. When you resume later, the framework might not have the full history unless you explicitly persist it to
/workspace for full context retention.Claude Agent SDK:/workspace.Best practice: Store conversation state in /workspace if you need it to survive VM restarts:What doesn’t persist
Installed packages
Installed packages
If your agent installs a package at runtime, it won’t be available in the next session:Solution: Add dependencies to
requirements.txt or pyproject.toml so they’re installed during deployment.requirements.txt
Environment variables set at runtime
Environment variables set at runtime
Environment variables your agent sets don’t persist:Solution: Set secrets via
superserve secrets set (see Credentials) or write to a file in /workspace:Process state
Process state
Running processes, background jobs, and in-memory state don’t survive:Solution: If you need a persistent background process, start it in your agent’s main loop or use a process manager that restarts on boot.
System-level changes
System-level changes
Modifications to system files outside Each session gets a fresh root filesystem. Only
/workspace don’t persist:/workspace survives.Session-specific workspaces
Each session has its own/workspace directory. If you start two different sessions for the same agent, they get separate workspaces:
/workspace directory. Sessions don’t share state.
Managing workspace size
The/workspace directory has a storage limit per session. If your agent generates large files, clean them up when no longer needed:
Persistence in practice
Example: Code review agent
Example: Multi-step research agent
/workspace will retain everything.
Isolation
Why sessions get fresh microVMs each time
Sessions
Multi-turn conversations and resuming
Deployment
How project files are packaged into /workspace
CLI Reference
Commands for managing sessions