| Type | Preserves | Use when |
| Full checkpoint | Disk, memory, and CPU state | You want the fastest fork or restore path from an exact running VM state. This is best for templates, important milestones, and branches you expect to fork often. |
| Disk-only checkpoint | Rootfs and workspace disk state | You want lightweight, frequent snapshots of files, installed packages, and workspace changes. Forks boot from the saved disks, so they are cheaper to keep but may take longer to become ready. |
kind: "disk_only" when creating autosaves or high-frequency checkpoints where disk state is enough.1234567891011121314import { Sandbox } from "@opencomputer/sdk"; const sandbox = await Sandbox.create(); await sandbox.exec.run("npm install && npm run build", { cwd: "/app" }); // Checkpoint after setup const cp = await sandbox.createCheckpoint("after-build"); // Fork two independent sandboxes const a = await Sandbox.createFromCheckpoint(cp.id); const b = await Sandbox.createFromCheckpoint(cp.id); await a.exec.run("npm run test:unit", { cwd: "/app" }); await b.exec.run("npm run test:e2e", { cwd: "/app" });
| Checkpoint | Hibernation | |
| Purpose | Fork new sandboxes from saved state | Pause and resume the same sandbox |
| Original sandbox | Keeps running | Stopped |
| Can fork | Yes — unlimited new sandboxes | No |
| Count | Up to 10 per sandbox, with optional oldest-checkpoint cleanup | One hibernation state |
| Use case | Parallel testing, branching experiments | Cost savings, idle timeout |
12const checkpoint = await sandbox.createCheckpoint("before-migration"); // checkpoint.id, checkpoint.status ("processing" → "ready")
processing to ready (or failed).1234const checkpoint = await sandbox.createCheckpoint("autosave", { kind: "disk_only", retentionPolicy: { mode: "delete_oldest", maxCount: 100 }, });
1const checkpoints = await sandbox.listCheckpoints();
123const forked = await Sandbox.createFromCheckpoint(checkpointId, { timeout: 600, });
1await sandbox.restoreCheckpoint(checkpointId);
1await sandbox.deleteCheckpoint(checkpointId);
| Field | TypeScript | Python | Description |
| ID | id | id | Checkpoint UUID |
| Sandbox ID | sandboxId | sandboxID | Source sandbox |
| Name | name | name | Human-readable name |
| Status | status | status | processing, ready, or failed |
| Size | sizeBytes | sizeBytes | Snapshot size in bytes |
| Created | createdAt | createdAt | Timestamp |
CheckpointInfo objects. Python returns raw dictionaries with the HTTP API field names.1234567891011121314const sandbox = await Sandbox.create(); await sandbox.exec.run("git clone https://github.com/user/repo /app"); const cp = await sandbox.createCheckpoint("fresh-clone"); // Try three different migration strategies in parallel const strategies = ["--strategy=ours", "--strategy=theirs", "--strategy=recursive"]; const results = await Promise.all( strategies.map(async (strategy) => { const fork = await Sandbox.createFromCheckpoint(cp.id); const result = await fork.exec.run(`cd /app && git merge origin/main ${strategy}`); await fork.kill(); return { strategy, exitCode: result.exitCode }; }), );