How to Checkpoint, Fork, and Roll Back Sessionspublic

Last verified 21 Sep 2026

DigitalOcean Harness Runtime provides managed, hardware-isolated microVM sandboxes with built-in tools such as Chromium to run harnesses and execute arbitrary code. Rich lifecycle APIs preserve conversational history and working state across sessions, letting you pause, resume, and fork work to control costs and adapt to the nonlinear nature of agentic workflows. Scale complete agents such as Claude Code or use sandboxes independently for code execution, all through the same service. See What You Can Build for example use cases.

A checkpoint is a save point for a Harness Runtime session. Harness Runtime captures the whole machine, both the workspace files and the agent’s live memory, so a restored session picks up where it was instead of replaying an approximation of its state.

From a checkpoint you can fork or roll back to a previous state. Forking creates independent copies of the session and leaves the original running. Rolling back rewinds the original session in place.

Creating checkpoints count towards your overall storage usage for snapshots and checkpoints. See the pricing page for details.

Create a Checkpoint

Create checkpoints manually with doctl or in the DigitalOcean Control Panel before you let the agent attempt something you might want to undo, such as a large refactor. A label makes the checkpoint easier to identify later:

doctl harness-runtime checkpoint create <your-session-name> --label before-refactor

To see the checkpoints for a session, inspect one, or remove one you no longer need, use the following commands:

doctl harness-runtime checkpoint list <your-session-name>
doctl harness-runtime checkpoint get <your-session-name> <checkpoint-id>
doctl harness-runtime checkpoint delete <your-session-name> <checkpoint-id>

Fork a Session Into Parallel Copies

A fork spins up independent copies of the session, each with its own session ID, while the parent session keeps running untouched. This lets you checkpoint before a risky change, try several approaches at once, and keep whichever one works.

Fork from a specific checkpoint and choose how many copies to create:

doctl harness-runtime fork <your-session-name> --from-checkpoint <checkpoint-id> --count 3

Omit --from-checkpoint to fork from the session’s current state instead.

To list the children a session has produced, filter the session list by parent:

doctl harness-runtime list --parent-session-id <your-session-name>
Note

Each fork counts against your concurrent session limit and starts a fresh transcript, and you attach to each fork individually. Forking is supported on the Codex CLI, OpenCode, and Claude Code adapters.

Roll Back a Session in Place

A rollback restores the checkpoint, rewinding the session rather than creating a new one. The session ID does not change, so any handle you already have stays valid:

doctl harness-runtime rollback <your-session-name> <checkpoint-id>

Fork when you want to keep the current state and explore alternatives alongside it. Roll back when you want to abandon the current state and return the session to the checkpoint.

Rollback permanently discards the live machine state created after the checkpoint: the platform boots a new microVM from the checkpoint, points the same session at it, and tears down the previous sandbox. The platform does not take an automatic checkpoint of the current state before rewinding, so create an explicit checkpoint first if you might need that later work.

Note

Rollback requires a session backed by a environment config. Config-less inline sessions cannot roll back.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.