October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Claude Code and Codex: How to Start a New Session Branch

Use /branch or --fork-session in Claude Code, and /fork or codex fork in Codex, to explore another approach while retaining the original conversation.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To try a different solution without losing your current conversation, fork its session: in Claude Code, run /branch in the active session or resume a saved session with claude --resume <session-id> --fork-session. In Codex, enter /fork in the current chat, or use codex fork to choose a saved session. Each creates a separate conversation history; neither command by itself gives the new conversation an isolated copy of your project files.

Choose the command based on where the conversation is

Tool Conversation How to fork What happens to the original
Claude Code Current interactive session Run /branch. The fork starts a separate session; the source session remains available.
Claude Code Saved session Run claude --resume <session-id> --fork-session. The resumed conversation is forked into a new session ID.
Codex Current chat Enter /fork. Codex creates a new chat with a fresh ID and leaves the original transcript untouched.
Codex Saved chat Run codex fork, then choose a session; or use codex fork --last for the most recent chat. The selected chat is copied into a new chat, leaving the source transcript untouched.

These commands are documented in the Claude Code sessions guidance, the Anthropic Agent SDK session-management cookbook, and the Codex CLI reference. The command forms below follow those references, checked October 7, 2026; product commands can change, so consult the live documentation if your installed version behaves differently.

As an Amazon Associate I earn from qualifying purchases.

Fork a Claude Code session

From the session you have open

  1. In the interactive Claude Code session, enter /branch.
  2. Continue in the branched conversation with the alternate approach. Keep using the original session if you need to return to its separate transcript.

From a saved session

  1. Find the session ID for the saved conversation you want to continue.
  2. Run claude --resume <session-id> --fork-session, replacing <session-id> with that ID.
  3. Continue in the new session created from the saved conversation.

The CLI route is useful when you want to resume a particular saved session rather than branch the conversation already on screen. The Agent SDK also supports forking from a selected message ID, so an SDK workflow can start from a point within a transcript rather than carrying forward the entire conversation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fork a Codex chat

From the current chat

  1. Enter /fork in the active Codex chat.
  2. Continue in the new chat to explore the alternate solution; the original chat transcript remains unchanged.

From a saved chat

  1. Run codex fork to open the session picker.
  2. Select the saved chat you want to branch. Codex creates a new chat based on it.

To skip the picker and fork the most recent chat, run codex fork --last. To target a particular saved chat, provide its session ID to codex fork. Add --all to include sessions outside the current working directory in the picker.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A conversation fork is not a project-file fork

Forking preserves a separate line of chat history. Do not assume it also creates a separate checkout or copy of the files being edited: the session commands described above concern conversation history, while file isolation is a separate repository setup decision.

If you plan to make changes in parallel, arrange project isolation separately—for example, use distinct Git worktrees or branches as appropriate to your workflow. Anthropic specifically recommends separate Git worktrees for multiple concurrent Claude Code sessions. Without file isolation, two conversations may still operate on the same working files, even though their transcripts are distinct.

Which route should you use?

  • Already in the conversation: use Claude Code /branch or Codex /fork.
  • Starting from a saved Claude Code session: use claude --resume <session-id> --fork-session.
  • Starting from a saved Codex chat: use codex fork to pick a session, codex fork --last for the latest one, or a session ID to target a specific chat.
  • Editing code in parallel: separately decide how to isolate the working files; a new transcript alone does not do that.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.