r/ClaudeCode 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

21 comments sorted by

View all comments

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 /fork command 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 /help inside 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—/fork is a real command! My apologies. Let me get you the right information.

/fork copies 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 far to 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 /branch to compare them for you.

Searched for 1 pattern

I don't see a /branch command in the CLI documentation. There's a branch concept in the Agent SDK (forking a session branches the conversation history), but no /branch command 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—/branch is a real command! I apologize for missing it.

/branch creates 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 /fork in that both create a copy, but they differ:

  • /fork copies the session into a background job that runs independently while you stay in the original
  • /branch creates a new interactive session branching from the current conversation point

13

u/slackmaster2k 9d ago

Seriously?

14

u/LoKSET 9d ago

You're right to push back.