Retain Claude session state on the host across sandbox removal
8.1K
Retain Claude session state on the host across sandbox removal
| Name | Required | Default | Description |
|---|---|---|---|
version | Required | — | Revision of the session-linking hook |
| Type | Required | Description | |
|---|---|---|---|
com.docker.sandbox/host-mount@1 | Required | — | |
com.docker.sandbox/lifecycle@1 | Required | — | |
claudesbx run <agent> --kit sbx/claude-sessions:latestRun the following command to install sbx on your machine.
brew install docker/tap/sbxwinget install Docker.sbxThis v3 mixin Kit retains Claude Code conversation state on the host across sandbox removal. It composes with either the Claude Code workload or its agent mixin.
This Kit is built on Docker Hardened Images.
sbx run sbx/claude:latest --kit sbx/claude-sessions:latest /path/to/workspace
This kit has no create-time kit arguments.
To configure the composed agent, set arguments on its workload or agent mixin, such as
--kit-arg claude.model=claude-sonnet-4-6. This mixin does not declare model or effort arguments.
The runtime mounts host storage at /home/agent/claude-history. Each sandbox uses a subdirectory named after that
sandbox, so simultaneous sandboxes do not share one writable session store. Reuse the sandbox name to reconnect to its
retained state. Scheduled jobs in ~/.claude/jobs persist alongside conversation state.
The kit retains the declared session data, not account credentials or the agent's complete configuration directory. Conversation history can contain workspace content and tool output. Authentication stays with the composed agent kit.
The install hook refuses to replace existing nonempty session state or unexpected symlinks. Move existing state into the
host-backed directory before adding this mixin to an existing environment. For jobs, move the contents of
~/.claude/jobs into /home/agent/claude-history/<sandbox-name>/jobs, using the sandbox name you will reuse, and leave
~/.claude/jobs empty. The hook refuses nonempty ~/.claude/jobs and does not migrate or overwrite existing files.
sbx/claude provides the complete agent workload.sbx/claude-acp provides the ACP adapter for the composed agent.sbx/claude-mixin provides the agent overlay for a compatible workload.For the Kit format and capability contracts, see the Sandbox Kit v3 specification.
For runtime setup, see the Docker Sandboxes documentation. For provenance, SBOM, VEX, and image verification, see the Docker Hardened Images documentation.
Claude, Claude Code, and Anthropic are trademarks of Anthropic PBC. Product names and logos do not imply sponsorship or endorsement.