Skip to main content
Checkpoints capture a sandbox’s full state (filesystem + memory). Fork new sandboxes from any checkpoint, or restore a sandbox to a previous point in time.

Create a Checkpoint

const checkpoint = await sandbox.createCheckpoint("my-checkpoint");
// { id: "uuid", name: "my-checkpoint", status: "processing" }

sandbox.createCheckpoint(name)

name
string
required
A name for this checkpoint.
Returns: Promise<CheckpointInfo> — status transitions from "processing" to "ready" once the snapshot is uploaded.

List Checkpoints

const checkpoints = await sandbox.listCheckpoints();
Returns: Promise<CheckpointInfo[]>

Fork from a Checkpoint

Create a new sandbox from a checkpoint. The new sandbox boots with the checkpointed filesystem state.
const fork = await Sandbox.createFromCheckpoint(checkpoint.id, {
  timeout: 600,
});

const result = await fork.commands.run("cat /root/data.txt");

Sandbox.createFromCheckpoint(checkpointId, opts?)

checkpointId
string
required
UUID of the checkpoint to fork from.
opts
object
Returns: Promise<Sandbox>

Restore a Checkpoint

Revert a running sandbox to a previous checkpoint. The VM reboots with the checkpointed drives.
await sandbox.restoreCheckpoint(checkpoint.id);
Returns: Promise<void>

Delete a Checkpoint

await sandbox.deleteCheckpoint(checkpoint.id);
Returns: Promise<void>