claude-code·Published 2026.06.01·Views 3
Claude Code /branch: Fork a Conversation to Experiment Safely
A beginner guide to the /branch command, which lets you try something different on a new fork while leaving your conversation so far intact — with the conc
While working, there are moments you think, "should I try another approach here? But what if everything I've done so far gets wiped out?" /branch is the command that leaves the current conversation as-is and opens up a new path from the same point.
Definition (what it is)
/branch is the command that forks the conversation in progress like a branch and lets you continue on a new branch. You can also use the alias (a short name for the same feature) /fork. The key point is that the original conversation is preserved as-is.
Like a tree branching out, think of it as copying the conversation flow from the current point and starting fresh. Whatever you try on the new branch, the original conversation isn't affected, so you can experiment with peace of mind.
How to use it (by difficulty)
Basic — Creating a branch
/branch experiment-A
Attach a name after it and a new branch is created with that name. A separate conversation forked from the current point begins, and the original stays as-is. It's good to give the name something that makes it easy to recognize which branch it was later.
Intermediate — Comparison-testing a different approach
/branch then try a different approach
After creating a branch, you try a method there that differs from the original. You can try approach A on one branch and approach B on another, then compare which is better.
Common pitfalls
- Creating a branch doesn't make the original disappear. Even if you work on a new branch, the original conversation lives on separately, so name your branches well to avoid confusion.
- When branches multiply, it can get confusing where you did what. When an experiment is done, it's good to clean up branches you no longer need.
Real-world example
From the same starting point, fork plan A and plan B separately, carry each direction through to the end, and then compare the results side by side. When you're torn over "should I build it with this structure or that one," it's a way to actually try both and choose.
Taking it further
Being able to fork a conversation and experiment means you can try boldly while protecting the original. Since you can come back to the original branch if things go wrong, you can take on challenges where you think "this might blow up" without hesitation.
Summary
/branch (alias /fork) is the command that forks the current conversation like a branch and lets you continue on a new branch. Since the original is preserved, use it when you want to experiment with a different approach safely.
Based on: Claude Code v2.1.154 (2026.05)
Comments
Comments 0
Checking sign-in status…
Loading comments…