Skip to main content
Patches attach bash scripts to a checkpoint. When a sandbox boots from that checkpoint or wakes from hibernation, all pending patches run automatically in sequence order.

Create a Patch

const result = await Sandbox.createCheckpointPatch(checkpoint.id, {
  script: "npm install lodash@4.17.21",
  description: "Pin lodash version",
});

console.log(result.patch.sequence); // 1

Sandbox.createCheckpointPatch(checkpointId, opts)

checkpointId
string
required
UUID of the checkpoint to patch.
opts
object
required
Returns: Promise<PatchResult>

List Patches

const patches = await Sandbox.listCheckpointPatches(checkpoint.id);
// [{ id: "...", sequence: 1, script: "...", description: "..." }, ...]

Sandbox.listCheckpointPatches(checkpointId, opts?)

Returns: Promise<PatchInfo[]> — ordered by sequence number.

Delete a Patch

Remove a bad or unwanted patch. Remaining patches continue to apply in sequence order.
await Sandbox.deleteCheckpointPatch(checkpoint.id, patch.id);

Sandbox.deleteCheckpointPatch(checkpointId, patchId, opts?)

checkpointId
string
required
UUID of the checkpoint.
patchId
string
required
UUID of the patch to delete.
Returns: Promise<void>

How Patches Apply

EventPatches run?
Sandbox.createFromCheckpoint()Yes — after boot
sandbox.wake()Yes — after restore
Sandbox already runningNo — next wake/boot
Patches run sequentially by sequence number. If a patch fails (non-zero exit), the chain stops. Progress is tracked per-sandbox, so the next wake retries from the last successful patch.