Omniscio

OmniscioGuidesClaude Code fork session

Claude Code fork session: branching a conversation, three ways

Claude Code can copy a live conversation and let you carry on in the copy while the original stays where it was. Three commands do it, and they are not interchangeable. This page says which one fits, what each copy inherits, how to get back to the original, and what a fork does not copy, which is your files.

Sources read November 15, 2026. By the Omniscio team. Updated .

Find the situation you are in

Forking a conversation is a small feature with three doors, so most questions about it end on this page.

Three neighbours own the rest. Undoing work inside one conversation belongs to the checkpoints guide. A conversation that will not load belongs to the failed to load a session guide. Handing a side task to a subagent, which is a fourth thing the word "fork" gets used for, belongs to the subagents guide.

What a fork is, and what it is not

A session is a saved conversation tied to a project directory, stored on your machine as you work. Forking one means copying that conversation into a new session with its own ID, so you can take it somewhere else without touching the history you already have.

Claude Code's own glossary describes it in one line: a session can be forked with --fork-session to preserve history under a new session ID.

What a fork copies, and what it does not

A fork copies the conversation, not your files, so a fork that runs while the original is still running works in the same folder and writes the same files. Anthropic's remote-session guidance says it plainly: both processes still work on the same files.

If you wanted two copies of the code, that is a git worktree or a clone, not a fork.

The word "branch" makes this harder than it needs to be

The git word and the conversation word are spelled the same. /branch in Claude Code creates no git branch and touches no repository. It copies the conversation and moves the running process onto the copy.

A third source of confusion: a skill with context: fork

There is a third source of confusion, and Anthropic's own documentation now flags it. A skill with context: fork does not fork the conversation at all, and the skills page says so in a note that begins "Despite the name". Issue 101153 below is about exactly that collision.

The three ways to fork a conversation

All three keep the original. What differs is where the copy runs and what happens to the window you are sitting in.

Which command to reach for.
CommandWhere you run itWhat happens to the copyWhere you end up
/branch [name]Inside a sessionA copy of the conversation, and the running process starts writing to itIn the copy, in this window
--fork-sessionA shell: claude --continue --fork-session or claude --resume <id> --fork-sessionA new session ID in a separate processIn the new process you just launched
/fork [prompt]Inside a sessionA new background session, its own row in agent view: the screen you open with claude agentsStill in the conversation you were in

Anthropic's command reference points from each of the first and third at the other, and the distinction it draws is exactly this one: use /fork to run a copy as a separate background session instead of switching into it.

That same entry says where it goes wrong. When agent view is turned off, /fork starts a forked subagent instead of copying the session, which is a different thing with the same name.

One more command shares the neighbourhood and it is not a fork of your conversation. /subtask starts a forked subagent, and before v2.1.212 that behaviour belonged to /fork itself.

Branch a conversation with /branch

Run /branch in the session you want to copy. The name is optional, and without one Claude Code names the new branch after the first prompt in the conversation:

/branch try-streaming-approach

A branch copies the transcript and switches the running Claude Code process to write to it. The original is left intact on disk, and the process you are typing into is now the copy, so every message from here lands in the new session.

The confirmation prints two session IDs, one for the new branch and one for the original. That line is worth keeping for a minute, because the original stays in the session picker and you return to it by name or by ID rather than by pressing back.

Anthropic points at this command from the checkpointing page as the way to try a different approach while preserving the session intact, in the place where you might otherwise reach for a summary. Summarising compresses the conversation you are in; branching leaves that conversation alone and gives you somewhere else to work.

Fork from the command line with --fork-session

The flag is one line in Anthropic's reference: when resuming, it creates a new session ID instead of reusing the original, and it is documented for use with --resume or --continue.

claude --continue --fork-session
claude --resume abc123 --fork-session

The first form picks up the most recent conversation in this directory and continues it in a copy. The second names a session and does the same to that one, which is how you fork a conversation that is not the last one you touched.

The copy is a real session

It gets its own ID and its own transcript file under your Claude directory, alongside the original, and it is resumable later like any other.

What does not come along automatically is your launch configuration. If the original session depended on --mcp-config, --settings, --plugin-dir, --fallback-model, or directories added with --add-dir, pass them again on the forking command.

Two documented edge cases

  • Resuming a background session that is still running opens that running session, and the documented way out is to add --fork-session so you work on a copy instead.
  • When you combine --bg with --continue or a bare --resume, Claude Code always starts a copy and prints a note explaining why, so adding --fork-session there makes the copy your choice rather than the tool's.

Copy the conversation into the background with /fork

Run /fork in the session you want to copy and you stay put. The copy becomes a new background session with its own row in agent view, and it starts from everything said so far, along with the model, the permission mode, the effort level, and any directories or "don't ask again" grants you added during the session.

Pass a prompt, as in /fork open a draft pull request with the work so far, and the copy starts on it straight away.

Leave the prompt out and the copy waits for its first instruction, which you send by selecting its row in claude agents and pressing Space, or with claude attach <id>. The confirmation is one line naming the copy's state, its row and its session ID.

Where the copy works

This is the question to ask before you use it on real code, and the answer is in the confirmation line.

Claude Code instructs the copy to create a worktree of its own before making changes, except when it edits in place. When the copy starts outside its own worktree, the confirmation ends with runs in the origin tree or edits this checkout, and a copy that edits this checkout is editing the files you have open.

Once it is running

The two conversations are independent: nothing the copy does enters the original on its own, though with cross-session messaging enabled either session's Claude can message the other. With agent view turned off, /fork does not copy the session at all, it starts a forked subagent.

Not every session can be copied this way. A session started with launch flags the copy would not inherit, such as a replaced system prompt or a --tools allowlist, is refused rather than copied in part, and Claude Code says so.

What the copy carries, and what it leaves behind

This table is what a /branch carries. Where a separate process forked with --fork-session behaves differently, the row says so, which is the difference worth knowing before you pick between them.

What a copy starts with.
StateAfter /branch
Conversation historyCopied into the branch up to the point you ran /branch
"Allow for this session" permission grantsCarried over, because the branch runs in the same process. A separate process forked with --fork-session starts without them, so you approve those actions again there
In-flight background subagents and background Bash commandsKeep running. Their output appears in the new branch you switched into, not in the original
Remote Control connectionStays connected, so a phone or browser attached to the session follows you into the branch and keeps receiving new messages there

The permission row has a second consequence that catches people in scripts. A session that ended in plan mode resumes in plan mode from a terminal, except when you pass --fork-session, where it starts in the permission mode a new session would start in. Passing --permission-mode explicitly settles it either way.

Other launch state is not inherited on a plain resume: the --mcp-config and --settings flags, plugin directories, a fallback model, and added directories all have to be passed again with claude --continue or claude --resume.

Two resume paths keep their flags instead: reopening a background session while it is still running, and resuming it by full session ID with --bg.

The fork also gets the original session's checkpoint backups, which is what lets /rewind work inside the copy. A backup that could not be copied is simply missing there, and the checkpoints guide covers what a rewind does when it needs one.

Getting back to the original

Return with /resume <original-name>, or pass the original's ID to /resume. The copy and the original are separate rows in the session picker, and when the picker finds more than one entry for what it considers the same session it groups them under a single row, which you expand with the right arrow.

Names resolve across the current repository and its worktrees, and the two ways of resuming treat ambiguity differently. claude --resume <name> with a name that matches more than one session opens the picker with the name pre-filled, while /resume <name> reports an error and asks you to run /resume with no argument instead.

On disk the two are separate files. Transcripts live at ~/.claude/projects/<project>/<session-id>.jsonl, where the project folder is your working directory path with non-alphanumeric characters replaced by a dash, so nothing about the copy overwrites the original's record.

A fork does not copy your files

This is the section to read before forking a session that is halfway through a refactor. The fork holds a copy of the conversation. The files are one set, shared by both, and any two processes working in the same folder write the same working tree.

Put plainly: a fork copies the conversation, not your working tree.

Resuming one session in two terminals at once without forking is the sharper version of the same problem, and Anthropic documents the outcome: both write to one transcript, and when you resume that session later, messages from one of them can be missing. The fork exists to avoid that, but it avoids it in the conversation only.

Worktrees are the tool for the file half. A session forked with --fork-session starts in the directory you launched Claude Code from, and the original session's worktree is left untouched, which keeps the two out of each other's working copies when the original was already isolated.

Two smaller effects

Two smaller effects belong here because they both look like a fork touching more than it said it would.

Background subagents and background Bash commands that were in flight when you ran /branch keep running, and their output arrives in the new branch rather than in the original.

And a copy that runs as a background session, whether you started it with /fork or with --bg, is told to make its own worktree before it edits anything, unless it edits in place. That is where a copy of a conversation also gets a copy of the files.

When it refuses, or surprises you

Each row below names its cause and what to do about it.

What you seeWhat it meansWhat to do
/fork says the session cannot be forkedIt was started with launch flags a copy would not inherit, such as a replaced system prompt or a --tools allowlist, and Claude Code refuses rather than making a partial copyRestart the session without that flag, then copy it
Workspace not trusted when you run /forkThe documented cause is a background session in a directory you have not trusted, where the trust dialog cannot appear, such as a script or a restart from another directory. A report below describes the same message in a project that has already recorded trustRun claude once in that directory and accept the prompt, then retry. If trust is already recorded, this is issue 103800 below, and /branch or --fork-session will copy the conversation meanwhile
/fork in a session that was already a copy, with no new prompt sent, gave an empty conversationA bug fixed in v2.1.246. Before it, a copy of a copy started blank while printing the normal confirmationUpdate Claude Code, or send the session one new prompt before you fork it again
/fork started a subagent instead of a background sessionAgent view is turned off, and /fork falls back to a forked subagent in that stateUse /branch or --fork-session for a conversation copy, or turn agent view back on
A rewind inside the copy says No files were restoredThe copy is missing a checkpoint backup it neededThe checkpoints guide owns that message and what to do about it
The forked session is not in plan modeA session that ended in plan mode starts, with --fork-session, in the permission mode a new session would start inPass --permission-mode to choose the mode yourself
Actions you had allowed are asking againSession-scoped grants do not cross into a separate process, which is where --fork-session runsApprove them once in the fork, or use /branch, which stays in the same process

One failure is worth naming separately because it is not a fork failure at all. If two processes resume the same session at once without forking, both append to one transcript, and the next resume can follow the branch written last and drop the other, which is what one of the reports below describes.

Forking one of them, or keeping one process on a conversation at a time, is the habit that avoids it.

What other people are reporting

These are open reports in Anthropic's issue tracker as we write this, not Anthropic statements.

A search of the tracker on October 27, 2026 returned 32 issues with "fork" in the title and 49 with "branch" in the title, both created in the previous 30 days.

The branch number is the looser of the two, because that word also matches every git-branch request in the tracker, and the reports below are the ones actually about conversations.

  • Issue 101153, open since 2026-10-11: "fork" is used for three different things, and the docs now carry a "Despite the name" warning about one of them. No reactions or comments yet.
  • Issue 97833, open since 2026-09-28: resuming a session that is already running in another process forks its transcript, and the next resume silently follows one branch and drops the other. 3 comments.
  • Issue 100216, open since 2026-10-07: the desktop sidebar nests forks under the session they came from, so a fork in active use sits buried under an old parent. 23 reactions, 12 comments.
  • Issue 102170, open since 2026-10-14: a request for a setting to undo that nested "forks as subordinates" layout. 1 reaction.
  • Issue 102566, open since 2026-10-15: a request for Claude Code to notice diverging threads and offer to fork them into seeded conversations. 1 comment.
  • Issue 103800, open since 2026-10-20: /fork failing with Workspace not trusted in a project that already recorded trust. No reactions or comments yet.

Four of those are not a copy going wrong: two are layout requests for the desktop sidebar, one asks for a feature, and one is a complaint about the vocabulary. The other two are behaviours of the CLI, the transcript divergence and the trust refusal, and they matter if you are deciding whether to work around something.

Where this page stops

This page owns copying a conversation: the three commands, what each copy inherits, returning to the original, and the file half. Three live guides own the neighbours.

  • Going back inside one conversation, with /rewind and its checkpoints, belongs to the checkpoints guide, which names --fork-session in passing and leaves this page its own subject.
  • A conversation that will not open, and the Failed to resume the conversation message, belongs to the failed to load a session guide.
  • Subagents, including the forked subagent and context: fork, belong to the subagents guide.

One surface note. The desktop app, claude.ai/code and the VS Code extension each keep their own session list, and this page follows the CLI, which is where Anthropic documents every command on it. For everything else about a session, the other Claude Code guides are the place to start.

Omniscio and forking

Omniscio is the desktop app we make for running many Claude Code sessions at once. The Claude Code sessions it starts run claude in print mode with stream-json input and output, so there is no interactive prompt in them for /branch to move you between, and /fork needs agent view, the screen you open with claude agents.

An aside

What the app does have is a fork of its own, in a different shape. An aside is a side question you ask from the session's overflow menu: the app spawns one Claude process that resumes the parent conversation with --fork-session, gets an answer, and exits.

The question and answer are stored as a sidechain and are invisible to the session's next real turn, so the detour adds nothing to the main thread's context. It is the one place in the app where Claude Code's own fork flag is used, and it is documented in the asides library page.

Re-run from here

The second one is a fork at the app's level rather than the CLI's. Re-run from here takes a message you pick, lets you reword it if it is yours or write the next one if it is Claude's reply, and starts a brand new session that shows the conversation up to that point and runs your version there.

The original is never changed, and a link back to it is pinned at the top of the new session. That is not --fork-session underneath: the new session is seeded with the carried conversation, which is why it also works for engines that have no such flag. The detail is in the re-run from a message library page.

The file half has its own switch

Whether a session works in your project folder or in its own copy is chosen before it starts, and every isolation switch is off by default.

Eight engines are the exception and isolate by default in a git repository: OpenCode, Pi, Gemini, Grok, Antigravity, Hermes, Kimi Code and DeepSeek Harness. Project and app defaults cannot turn that off, though a per-session choice can. The session isolation library page covers it.

If you are running several conversations at once, the features page lists what the app does and the download page has the installers.

Sources

Every Claude Code behaviour on this page rests on one of these pages, and each was read on the date beside it.

  • Manage sessions, for /branch, the inherit table, the confirmation line, the picker rows, how names resolve, and where transcripts live. Read November 15, 2026.
  • Commands, for the /branch, /fork and /subtask entries and what each points at. Read November 15, 2026.
  • CLI reference, for the --fork-session row and its usage with --resume. Read November 15, 2026.
  • Agent view, for /fork, what a copy carries, where it runs, the sessions that cannot be forked, and the v2.1.212 and v2.1.246 release notes. Read November 15, 2026.
  • Worktrees, for where a --fork-session session starts and what it does to the original's worktree. Read November 15, 2026.
  • Errors, for the fork note under No files were restored and the Workspace not trusted section. Read November 15, 2026.
  • Checkpointing, for the line sending a different approach to /branch rather than a summary. Read November 15, 2026.
  • Skills, for the "Despite the name" note on context: fork. Read November 15, 2026.
  • Glossary, for the one-line definition of a forked session. Read November 15, 2026.
  • Claude Code in the desktop app, for the warning about resuming a running conversation over SSH. Read November 15, 2026.
  • The six issue pages linked above, each read through GitHub's API on October 27, 2026 and again on November 15, 2026, with its state, reaction count and comment count taken from the API on both days.
  • Two capture runs on this machine on October 27, 2026: claude --version, which printed 2.1.311 (Claude Code), and a text search of that installed build for the fork flag and the branch description. The version was read again on November 15, 2026 and printed 2.1.325 (Claude Code).

Forking changes with releases. The changelog carries a fix to a copy-of-a-copy bug as recently as v2.1.246 and a change of what /fork means at v2.1.212, so re-read the sessions and agent-view pages before trusting a copy of this page from last month.

Common questions

How do I fork a Claude Code session?

Three commands do it, and they differ in where the copy runs. Run /branch inside a session to copy the conversation and switch into the copy. Run claude --continue --fork-session, or claude --resume <id> --fork-session, to start a separate process on a new session ID. Run /fork to copy the conversation into a new background session while you keep working where you are.

What is the difference between /branch and /fork?

/branch switches you into the copy, in the same Claude Code process, leaving the original saved. /fork sends a copy to a new background session and leaves you in the conversation you were in. Both keep the original, and Anthropic's command reference points at each from the other for exactly that reason.

Does forking a session copy my files?

No. A fork copies the conversation, not your working tree. Two processes working in the same folder still edit the same files, which is why Anthropic's remote guidance pairs --fork-session with a warning that both processes work on the same files. What a fork does copy is the session's checkpoint backups, so /rewind has something to restore in the copy.

How do I get back to the original conversation after branching?

The /branch confirmation prints two session IDs, the copy you are now in and the original, which stays unchanged on disk. Return to it with /resume <original-name> or by passing its ID to /resume. In the picker the two behave as separate rows, grouped under one entry until you press the right arrow to expand the group.

Does --fork-session keep my permission grants?

No. Permission grants you accepted with allow for this session are carried into a /branch, because the branch stays in the same process. A fork into a separate process with --fork-session starts without them, so you approve those actions again there.