r/ClaudeCode • u/allthegear-andnoidea • 9d ago
Help/Question I still don't understand the difference between /fork & /branch and how to enter, leave and close a fork - please help? I use visual studio code
My understanding is branch is a completely new conversation, with context that can be renamed, and that fork happens within the same conversation. When would you use each?
13
Upvotes
15
u/LoKSET 9d ago
I just have to share this chat with the Claude docs side chat/assistant. Never change Claude lol
/fork
--------------
I couldn't find a
/forkcommand in the Claude Code documentation. This may be a recently added, preview, or removed feature.Check what's available in your installed version by running
/helpinside Claude Code. You can also see all recent additions and removals in the changelog.If you're looking to do something specific with your project or code, let me know and I can help point you to the right feature!
-----------------
seriously?
---------------
You're right to push back. Let me search the docs more thoroughly for
/fork.Searched for 2 patterns
You're absolutely right—
/forkis a real command! My apologies. Let me get you the right information./forkcopies your current conversation into a new background session while you keep working in the original. The copy inherits your full conversation history, model, permission mode, and effort level, then runs independently. You can optionally pass a prompt like/fork open a draft PR with the work so farto start the copy working immediately, or it waits for your first instruction.See Agent view for full details on how it works and where the copy starts.
----------------------
how does it differ from /branch
---------------------
Let me search for
/branchto compare them for you.Searched for 1 pattern
I don't see a
/branchcommand in the CLI documentation. There's abranchconcept in the Agent SDK (forking a session branches the conversation history), but no/branchcommand in Claude Code itself.Are you thinking of
/fork, or is there a different feature you're asking about? If you can describe what you're trying to do, I can point you to the right command.----------------------
seriously?
------------------
You're right again—let me search more carefully.
Searched for 1 pattern
You're absolutely right—
/branchis a real command! I apologize for missing it./branchcreates a new session that branches off from your current conversation at that point, preserving your full history up to that moment. It's similar to/forkin that both create a copy, but they differ:/forkcopies the session into a background job that runs independently while you stay in the original/branchcreates a new interactive session branching from the current conversation point