Skip to main content

Save and restore

A snapshot is restorable the moment the call returns and durable (survives the node it was born on) seconds later; wait_durable=True blocks for that. snapshot(leave_paused=True) parks the vCPUs right after the checkpoint — the next call wakes it in ~10–20 ms — the right shape for a snapshot-every-turn agent loop that idles across model calls. Sharp edges: restoring takes the snapshot’s shape (cpus/memory are not overridable at restore). Deleting a sandbox does not delete its snapshots. Export (downloading a snapshot’s bytes out of the platform) is experimental — see the HTTP API reference.

Fork for parallel work

A fork is a live checkpoint + restore: children resume the parent’s exact processes and open files. Up to 4 per call at launch. Use one fork(n) call, not n fork() calls — the fan-out takes a single checkpoint of the parent. Sharp edges: external network connections are duplicated into every child (each side thinks it owns the socket) — close connections you don’t want forked, or fork between commands, not mid-flight.