Skip to content

Forking a Workspace

Sometimes the right next step isn’t another message to the same agent — it’s a second agent. The conversation has grown long and slow, you want to try a different direction without losing this one, or the agent has built something worth keeping but the chat has gone sideways. Fork creates a new workspace from an existing agent, and you choose exactly what it carries.

Every fork picks one option from each axis:

Code

  • Clean worktree — a fresh checkout from the base branch, as if you’d spawned a new agent normally.
  • With current code — the fork’s checkout starts as a copy of the parent’s current working tree, including uncommitted changes. The new agent builds directly on what the parent has done so far, committed or not.

Context

  • Fresh chat — the new agent starts with no history.
  • Full history — the parent’s entire conversation carries over.
  • Up to a message — history carries only up to a turn you pick.

Carried context does two things at once: the prior transcript is copied into the new chat, so you can read the history — and a plain-text digest of that same history (messages, reasoning, tool calls and their results) is folded into the new agent’s standing instructions, so the agent actually knows it. Because the digest is plain text, context survives forking across providers: you can fork a Claude Code session into a Codex agent and it keeps the thread.

  • Under any finished turn, a fork button offers Fork here · clean worktree and Fork here · with current code — both carry the conversation up to that turn. This is the “the chat went wrong after this point” and “explore a branch from here” tool.
  • In the workspace header, the fork menu offers Full history · clean worktree, Full history · with current code, and Fresh chat · with current code — the whole-workspace variants.

The fork is an ordinary new agent in an ordinary new workspace: same sandbox rules, and it inherits the parent’s agent, model, instructions, skills, and tools. The parent is untouched and keeps running.

  • Full history · clean worktree — the conversation is valuable but the code took a wrong turn: keep the knowledge, restart the implementation.
  • Fresh chat · with current code — the code is valuable but the conversation is bloated: a common way to “compact” a long session without losing uncommitted work.
  • Fork here · with current code — race two continuations of the same work: fork at the decision point and send each agent down a different path.