Skip to main content
UltraContext - Fork & Clone contexts guide cover

Guide Overview

After this guide, you’ll be able to:
  • Fork contexts to explore different flows
  • Rollback when things go wrong
  • Create safe copies for experimentation
The nicest part? Without losing a single bit of data.

Why Fork & Clone contexts?

We’ve all been there. You had a great conversation with Claude. It finally gets your codebase, the problem, the constraints. Then the conversation gets too long. It starts forgetting. Contradicting itself. You want to scream. What if you could capture that perfect moment? Fork right when the LLM still has all the context. Branch in new directions while keeping the original intact. Freedom to explore. Always being able to come back. Here is where UltraContext comes in. Fork & Clone contexts diagram using UltraContext Wanna rollback to a previous version? Test a different conversation flow? Different system prompt? Different model? Different tools? You name it. We’ve got your back. And without losing a single bit of data.

Forking

Create a copy of an existing context:
In Python, use from_ (with underscore) since from is a reserved keyword.
create() without from creates a new empty context. The version, before, and at params require from.

By Version

Gets exact state after that update or delete.

By Timestamp

Gets state at that moment (finds version + filters messages).

By Index

Gets first N messages (indices 0 to at).

Using metadata to find index

Find a checkpoint marked with metadata, then fork up to that point:

Combine All

Order: version → filter by time → slice by index.
When using version and before together, version selects the base state, then before filters messages within that version.

Add Metadata

Track why you forked:

Examples

Compare Prompts

Fork to test different prompts from the same starting point.

Compare Models

Fork to test the same prompt across different models.

Rollback on Error

Automatically revert when something goes wrong.
Always capture the version number BEFORE attempting risky operations. This gives you a clean rollback point.

Conversation Branching UI

Let users explore “what if” scenarios.
Store branched_from in metadata to build a tree view of conversation branches in your UI.