Skip to main content
A checkpoint saves a sandbox’s filesystem so you can start new sandboxes from it later, or fork a running one to branch your work. It captures the sandbox’s root filesystem only — data on mounted volumes is never included. A filesystem checkpoint holds files only: processes start fresh and nothing in memory carries over. Other operations also capture memory and running processes: A filesystem checkpoint is usable once it reaches DURABLE. From then on it outlives its source sandbox. Checkpoint storage is billed separately.
snapshot and fork --with-memory need prime 0.23.0 or later, or prime-sandboxes 0.5.14 or later for the SDK.
Keep the source sandbox alive until the checkpoint is DURABLE. If it’s deleted or hits its timeout first, the checkpoint is lost.

Fork

The quickest way to branch a running sandbox. It checkpoints, waits for DURABLE, and starts a new sandbox from it:
The fork inherits the source’s CPU, memory, and timeout unless you pass --cpu-cores, --memory-gb, or --timeout-minutes. Use --wait-timeout (seconds) to cap how long it waits for the checkpoint. --with-memory forks the source’s memory and running processes too:
The source is paused for the snapshot and resumed asynchronously; check prime sandbox get sbx_123 before using it again. The fork takes the paused sandbox’s shape, environment, and secrets, so --with-memory rejects --cpu-cores and --memory-gb. It also rejects --volume: a memory fork continues the paused guest and attaches no volume. GPU sandboxes and sandboxes with volumes cannot be paused, so they cannot be memory-forked.

Memory snapshots

snapshot captures a sandbox’s disk, memory, and running processes without creating another sandbox. It pauses the source, waits until the pause checkpoint is restorable and the source is PAUSED, then resumes the source. The returned checkpoint restores with --memory.
--wait-timeout (CLI) or timeout_seconds (SDK, default 300) bounds only the pause-ready wait. The source’s resume is asynchronous, and the returned checkpoint is not necessarily DURABLE: it shows FROZEN or DURABLE when the source is PAUSED. prime sandbox checkpoint get <checkpoint-id> shows its state and size; it does not report whether memory was stored. wait_for_checkpoint waits for disk durability, not proof that the memory snapshot was stored. A pause checkpoint whose memory has not yet been stored can be memory-restored only on the pausing node, while the source exists; a disk-only restore needs DURABLE. DURABLE stores the checkpoint’s disk off the pausing node, so a disk restore survives source deletion, but it does not guarantee the memory was stored: memory that misses the platform’s pause window (currently 6 hours) is dropped. A pause checkpoint has no TTL, but its disk must become DURABLE within about 6 hours of the pause, and its memory within about 6 hours after that. Paused time counts against the source’s timeout. GPU sandboxes and sandboxes with volumes cannot be paused, so they cannot be snapshotted. If the response is lost and the source shows PAUSED, continue it with prime sandbox resume sbx_123.

Restore memory

checkpoint restore <checkpoint-id> --memory (CLI) or create(..., restore_memory=True) (SDK) creates a new sandbox that continues the paused sandbox’s memory, processes, environment, and secrets. It never restores into the source, and the same pause checkpoint can be restored more than once. A memory restore uses the paused sandbox’s shape: leave out --cpu-cores and --memory-gb. It cannot attach volumes, and gang members cannot restore memory. The platform needs the source sandbox record, which it keeps for at least 7 days after termination; once that record is removed, only a disk restore is possible. Set the new sandbox’s lifetime explicitly: --timeout-minutes (CLI) and timeout_minutes (SDK) default to 60 even for a memory restore. A restore copies userspace random state and any keys or tokens already in the guest’s memory. Rekey or regenerate them in the restored workload.

Checkpoint and restore

These examples restore a filesystem checkpoint’s disk; processes start fresh. To continue a paused sandbox’s memory and processes, use --memory as described above.
The image and disk size come from the checkpoint, so leave out docker_image and disk_size_gb in the SDK. Everything else (resources, env vars, timeouts) works as usual; the CLI restore accepts --cpu-cores, --memory-gb, --timeout-minutes, and --team-id. wait_for_checkpoint returns once the checkpoint is DURABLE. It raises RuntimeError if the checkpoint fails and TimeoutError if the wait runs out. A timeout doesn’t mean the checkpoint failed, so check it with get_checkpoint before deleting the source sandbox. list_checkpoints(sandbox_id) lists a sandbox’s checkpoints.