The sandbox and its state
- Approved by
- Panaversity ·
The session cloud workspace
[Vendor-documented] Each cloud session runs in its own temporary sandbox, on computers that Anthropic manages. No state is shared between sessions or between organizations.1 [Observed] In the session examined, the sandbox was a Linux microVM with Python, Node, a shell and file tools. This is the borrowed desk from Where the work happens.
| Aspect | How it works | Basis |
|---|---|---|
| Scope | One sandbox for each session, not shared with other chats | Vendor-documented |
| Persistence | Files and installed packages last from one turn to the next within the session | Observed |
| Lifetime (end of session) | Destroyed when the session ends | Vendor-documented |
| Lifetime (idle time) | Paused and later restored, or reclaimed and replaced | Vendor-documented for Claude Code cloud sessions. Inferred for the chat examined here |
| Background work | A process the shell detaches (with nohup or &) usually stops a few minutes after a reply ends. The harness's own background jobs run until their time limit | Tool-documented (the session's environment notes) |
| Network | Outbound traffic goes through a proxy, to allowed places only (an allowlist). Web lookups use separate tools | Vendor-documented and observed |
| Your computer | Reached only through the Claude desktop app, and only in the folders you connect | Vendor-documented and observed |
[Vendor-documented] Availability depends on the product and plan. Cloud tasks in a conversation are available on Pro, Max and Ultra, in beta on Team, and on Enterprise once an owner turns them on.1 Claude Code cloud sessions are available on Pro, Max and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats.2 The desktop app's Code tab also lets you choose Local, Cloud, SSH or WSL for each session.3 The settings that shape a cloud sandbox are in Cloud environments and self-hosted runners.
Demo: a Python program in the VM
[Observed] On November 8, 2026, a script named hello_vm.py was created, saved and run inside the session workspace.4 It printed:
Hello from the session VM!
Python: 3.13.18
OS: Linux-6.18.44-fc-v310-x86_64-with-glibc2.39
Working dir: /home/claude
Time (UTC): 2026-11-08 04:34
Squares 1-10: [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] sum = 385[Observed] Between writing the file and running it, the session was interrupted and resumed. The run had not happened. The file came back as a read-only copy from the conversation. [Inferred] The workspace had been replaced, because a restored VM keeps its own files. So anything installed or running was lost. A second change on November 9 is weaker evidence, as explained below.
The lesson: treat the VM as scratch space, a place for temporary work. Keep anything that matters in a delivered file, an artifact, Drive or a repository.
Where chat history lives
[Vendor-documented] Sessions and files are saved to the user's Claude account.1 [Observed] The harness held its own working copy of the conversation in the VM. [Inferred] The browser also holds only a copy. The saved record is the one on the account.
| Place | What it holds | Survives a replaced VM? |
|---|---|---|
| Anthropic backend | The stored conversation, reachable from any device | Yes |
| Browser or app | A cached copy, kept for display | It reloads from the backend (inferred) |
| Harness in the VM | The working context for each model call, plus a transcript on disk | Not if the VM is replaced. It is rebuilt from the backend (inferred) |
The chat survived the replaced VM in the demo, because the backend copy counts. In local Claude Code, the transcript lives on your machine.
When the VM is paused, restored or replaced
[Vendor-documented] The sandbox is destroyed when the session ends.1 For Claude Code cloud sessions, Anthropic also documents what happens to an idle VM. "After a few minutes without activity, a session's VM pauses with its files saved. Your next message restores the same VM and starts Claude Code again." But "if the paused VM has since been reclaimed, reopening the session provisions a fresh VM." Reclaiming also stops background work that was still running.2,5
[Observed] In the session examined here, two things were seen. During the demo, the file came back only as a read-only copy from the conversation. On November 9, PID 1 had been running for about 19 minutes, after a long idle gap.
[Inferred] The demo fits a reclaimed VM and a fresh one, because a restored VM keeps its files. The uptime is weaker evidence. A restored VM may not count paused time as uptime. So a short uptime alone does not prove a new machine. [Unknown] Whether this chat session follows the documented Claude Code rules, and how long a paused VM is kept before it is reclaimed.
[Inferred] Pausing and reclaiming save computing power and keep each session clean.
| Survives a reclaimed VM | Lost when the VM is reclaimed |
|---|---|
| The chat itself | Installed packages |
| Files from the conversation (restored as copies) | Running servers and background jobs |
| Artifacts and docs | Environment variables and temporary files |
| Memory and connected apps | Anything not written back into the conversation |
| Anything saved to your computer, Drive or a repository |
In practice, plan for a fresh VM after a break, even though a short break may only pause it. Scripts should check for what they need and install it. Save important output outside the VM. Projects build this habit into the product.
Stateful sessions on a stateless model
The model is stateless, but the session around it remembers. The harness makes the difference.
- Stateless model. The model keeps no memory between calls. For each call, the harness builds the context from instructions, the relevant history, tool results and the current state. When the context grows too large, the harness may compact it, summarize it, or fetch only what it needs. The session examined was configured to auto-compact at 80%. Prompt caching makes repeated context faster to process, but it is not memory.
- Stateful session. Between calls, the harness holds a transcript, the VM's files, packages and tool results.
| Layer | State it holds | Lifetime |
|---|---|---|
| Anthropic backend | The conversation | Saved to the account (vendor-documented). How long it is kept is not covered here |
| Harness and VM | Working files, the environment, the transcript on disk | Until the VM is reclaimed or the session ends |
| Outside stores (memory, artifacts, Drive, repositories) | Whatever you save there | As long as you keep it |

The model is a stateless function. The harness turns it into a stateful agent. With the API or the Agent SDK, your own code holds that state.
Check yourself
Question 1 / 4
0 answered
In the Python demo, what happened when the session was interrupted and resumed?
Sources
- As verified on November 9, 2026. Claude Cowork architecture overview, Anthropic.↑↑2↑3↑4
- As verified on November 9, 2026. The page quotes the idle pause and restore. Configure cloud environments, Anthropic.↑↑2
- Claude Desktop: Code tab docs, Anthropic.↑
- As verified on November 9, 2026. "Cloud sessions stop after a period of inactivity and the session's VM is reclaimed." Use Claude Code in the cloud, Anthropic.↑
- Owner
- Panaversity