Skip to main content
A fork is a sibling run within the same session, started from a chosen message boundary of an existing run. Use it to explore alternative paths, run evals from a known-good state, or A/B-test instructions.

Basic Usage

The new run has a fresh run_id, forked_from_run_id pointing at the source, and forked_from_message_index recording where it cut.

Where to Fork From

continue_from chooses the message boundary. For valid integer indices on a specific run, call the checkpoints endpoint. Every index it returns is pair-safe.

Forking vs Regenerating

If you want a cheap “try again with steering” without re-running tools, use Regenerate. If you want to rewind further (drop tools, drop intermediate turns, change the prompt entirely), fork.

Auto-Fork on COMPLETED

Continuing a completed run always produces a new run_id, even without fork=True:
The 1-run-1-loop invariant: a completed model loop cannot be overwritten. The new turn always lands on a new run row.

Pair-Safe Truncation

Integer continue_from=K snaps down to a “pair-safe” boundary when K lands mid-tool-batch. Given the transcript:
The fork response’s forked_from_message_index reflects the actual boundary used. If it differs from what you sent, the dispatch snapped the index down. Indices returned by the checkpoints endpoint are always pair-safe by construction.

Teams

Team.continue_run(fork=True, continue_from=...) works the same way:
The forked team is a new run in the same session. Member runs from the original team stay attached to the original via parent_run_id. The fork starts fresh and may produce new member runs.

HTTP

continue_from accepts "end", "last_user", or a numeric string (e.g. "4").

Examples

Agents

Teams

Next Steps