State Persistence & Restore
Ash persists workspace state so sessions can survive sandbox eviction, server restarts, and even machine migrations. This page documents the storage architecture, the three-layer restore fallback, and the periodic cleanup strategy.
Storage Layers
Workspace state is stored in up to three locations, each serving a different durability need:
| Layer | Location | Durability | Speed | Purpose |
|---|---|---|---|---|
| Live workspace | data/sandboxes/<sessionId>/workspace/ | Process lifetime | Instant | Active sandbox reads/writes |
| Local snapshot | data/sessions/<sessionId>/workspace/ | Disk lifetime | Fast (local copy) | Survives sandbox eviction and server restart |
| Cloud snapshot | s3://bucket/... or gs://bucket/... | Indefinite | Slow (network) | Survives machine loss, enables cross-runner resume |
What gets persisted
The entire workspace directory is copied — agent source files, .claude session state (conversation history, tool results), and any files the agent created during the session. Large reproducible directories (node_modules, .git, __pycache__, .venv) are excluded to keep snapshots small and fast.