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

# Chat forking

> Move a chat to another coding agent harness without losing its context.

Forking hands a chat that started on one harness (for example [Claude Code](https://docs.replicas.dev/features/coding-agents/claude-code.md)) to another harness (for example [Codex](https://docs.replicas.dev/features/coding-agents/codex.md) or [Cursor](https://docs.replicas.dev/features/coding-agents/cursor.md)) in the same workspace. The original chat is left exactly as it was. Forks are instant and deterministic: no model summarizes the conversation.

## How it works

1. Replicas reads the source chat's transcript, strips tool noise, redacts secrets, and saves the sanitized transcript inside the workspace. Chats larger than 32 MB are sanitized from their most recent part only; the complete raw event log stays on the workspace for the agent to grep, and the handoff says so.
2. The forked chat's first message says where the chat came from, links the sanitized transcript and the raw event log so the agent can read or grep them, and inlines the most recent turns.
3. A manual fork attaches this to the first message you send. An automatic fork resends the source chat's last request if it was never answered, so the new harness finishes it.
4. Forked chats show a fork icon on their tab; hover it to see the source chat.

Workspace files and git state are shared, so the new harness continues from the same code.

## Fork a chat manually

Click **+** after the chat tabs in the workspace header and choose **Fork this chat**. A new chat opens right away on the same harness, and nothing is sent yet. Switch the harness, model, effort, or mode in the composer like any new chat, then send your message. The transcript handoff goes out with it.

The option appears once the workspace is awake, and only in workspaces whose engine supports it. Older workspaces do not show it; create a new workspace to fork their work.

## Switch harness in the same chat

Pick a different harness from the model picker in a chat that has already started. A dashed line at the end of the chat shows the switch, and nothing changes until you send. Your next message continues the same chat on the new harness, with the conversation handed over the same way as a fork, and a **Context handoff** line marks where the harness changed. Pick the original harness again to cancel.

* If the agent is working, sending stops it first. Messages still queued go to the new harness after yours.
* Every switch hands over the whole chat, including the turns of each harness it ran on before.
* Messages sent to the chat from elsewhere, such as its Slack thread, go to the harness it runs on now. Its side chats follow it.
* Picking another model on the same harness keeps the chat's session.
* A chat with an active goal can't switch in place until the goal is cleared.

The API does the same when a [message](https://docs.replicas.dev/api-reference/replica/send-message.md) to a `chat_id` names another `coding_agent` than the chat's.

## Side chats

Type `/btw <question>` or `/side <question>` in a chat to ask about it without interrupting it. Images and files attached to that message go to the side chat with it. A **Side chat** tab opens in the workspace sidebar with a fork of the chat on the same harness and model, and you keep the conversation going there. Nothing you say in it is added to the main chat.

* Each message you send it carries the main chat's newest turns, and the full transcript stays in the workspace for it to read, so it can answer about work the main chat is still doing.
* It can read the workspace, and is told not to change files unless you ask.
* Its prompt box has the same controls as the main chat: plan, fast, and goal modes, model, effort, and image and file attachments. A new side chat can also run on a different harness.
* Messages sent while it is busy are [queued](https://docs.replicas.dev/features/workspaces/overview.md), the same as in the main chat.
* A chat can have several side chats. Click **+** to start another and switch between them from the menu at the top. `/btw` on its own opens the sidebar.
* **✕** takes you back to the sidebar tab you were on. The **Side chat** tab stays, so you can return to it anytime. To delete a side chat, use the trash icon next to it in the menu, then click **Undo** or restore it later from **Deleted side chats**.
* On the web, select text in the chat and click **Ask in side chat** to quote it in your next side chat message.
* Side chats are available after a chat's first message, in workspaces whose engine supports them.

## Automatic fallback

A harness's [fallback chain](https://docs.replicas.dev/admin/credentials.md#fallback-chains) can fork the chat instead of, or before, switching credentials. Forks only happen after the harness hits a usage limit or runs out of credits, never because a login is broken.

1. Open the **Fallbacks** tab under **Coding Agents** ([Personal](https://app.replicas.dev/dashboard/account/agents?tab=fallbacks), or [Organization](https://app.replicas.dev/dashboard/agents?tab=fallbacks) for admins).
2. Under the harness, click **Add step**, choose the harness to fork to, and drag it to where it should run. Placing **Codex** right after the Claude subscription forks as soon as the subscription runs out; placing it last forks only after every credential is spent.
3. Pick the model the fork runs on from the menu on the step.
4. Only harnesses with credentials in the workspace are used, and a chat never forks back to a harness already in its fork ancestry.

Automatic forks use the step's model, or your agent defaults when it is set to **Default model**, and resend the interrupted request so the new harness picks up where the previous one stopped. The fork replaces the original in the chat list, keeps its name, and shows as one chat, with a marker where the harness changed. Messages sent to the original chat, such as replies in its Slack thread, go to the fork.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.