> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opencomputer.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# oc checkpoint

> Manage sandbox checkpoints

**Alias:** `oc cp`

## `oc checkpoint create <sandbox-id>`

Create a named checkpoint of a running sandbox. [HTTP API →](/api-reference/checkpoints/create)

<ParamField query="--name" type="string" required>
  Checkpoint name
</ParamField>

<ParamField query="--retention-policy" type="string" default="none">
  Optional retention policy. Use `delete_oldest` to delete the oldest eligible checkpoint before creating this one.
</ParamField>

<ParamField query="--retention-max-count" type="int" default="10">
  Maximum checkpoints of this type to keep when `--retention-policy delete_oldest` is set. Must be between 1 and 10 for full checkpoints, or 1 and 100 for disk-only checkpoints.
</ParamField>

```bash theme={null}
oc cp create sb-abc --name before-migration
```

```bash theme={null}
oc cp create sb-abc \
  --name autosave \
  --kind disk_only \
  --retention-policy delete_oldest \
  --retention-max-count 100
```

***

## `oc checkpoint list <sandbox-id>`

List checkpoints for a sandbox. [HTTP API →](/api-reference/checkpoints/list)

Output columns: `ID`, `NAME`, `STATUS`, `SIZE`, `CREATED`

***

## `oc checkpoint restore <sandbox-id> <checkpoint-id>`

Revert a sandbox in-place to a checkpoint. All changes since the checkpoint are lost. [HTTP API →](/api-reference/checkpoints/restore)

***

## `oc checkpoint spawn <checkpoint-id>`

Create a new sandbox from a checkpoint (fork). [HTTP API →](/api-reference/checkpoints/fork)

<ParamField query="--timeout" type="int" default="300">
  Idle timeout for the new sandbox
</ParamField>

```bash theme={null}
ID=$(oc cp spawn cp-xyz --json | jq -r '.sandboxID')
oc exec "$ID" --wait -- echo "forked sandbox ready"
```

***

## `oc checkpoint delete <sandbox-id> <checkpoint-id>`

Delete a checkpoint. [HTTP API →](/api-reference/checkpoints/delete)
