# /branch Command

> It copies the chat so far and moves you into the copy.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** /branch, --fork-session, Branch a conversation

## Think of it like

It is like a path that splits in two. You walk down the new one, and the old one is still there.

## Definition

/branch makes a copy of the conversation at this point and moves you into the copy. The original stays as it was, and /resume takes you back to it. Use it to try another idea without losing the chat you have. Give it a name, or it is named after the first prompt. It copies the conversation only. Both branches work on the same files.

## Example

Jack and Claude have a plan for a cache. He wants to see a second plan too, so he types /branch. If the new plan is worse, he resumes the first chat.

## Example code

```console
/branch try-streaming
```

Try a new idea in a copy of the chat.

## Why it matters

You can explore a risky idea and still keep the good chat you had before it.

## Common mistake

Thinking the branch also has its own copy of the code. It copies the talk only. Edits in one branch change the files the other one sees.

## Three principles

- **A copy of the chat.** Up to this point.
- **You move into it.** The original waits.
- **Same files.** Only the talk is copied.

## Related terms

- [/fork Command](https://learn.benibix.com/term/ai/fork-command)
- [/resume Command](https://learn.benibix.com/term/ai/resume-command)
- [Claude Code Checkpoint](https://learn.benibix.com/term/ai/claude-code-checkpoint)
- [Claude Code Session](https://learn.benibix.com/term/ai/claude-code-session)

## Told apart from

- [/branch vs /fork](https://learn.benibix.com/compare/branch-command-vs-fork-command): People often think /branch and /fork do the same thing. Both copy the chat, but they put you in different places. /branch moves you into the copy, and the original waits for you in /resume. /fork sends the copy off to run as a background session, and you stay where you were. /branch also shares your files, while a fork is told to work in its own worktree.

## Taught in

- [Resume, Branch and Rename](https://learn.benibix.com/learn/ai-claude-code-commands/resume-branch-and-rename): Claude Code Commands, 4/17

![Four rows. /branch splits the chat and moves you into the copy. /fork sends a copy to the background and you stay. /subtask sends a helper that brings its answer back. /background moves the whole chat to the background.](https://learn.benibix.com/diagrams/cmd-session-moves.svg)

---

Source: https://learn.benibix.com/term/ai/branch-command
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
