# Resume, Branch and Rename

> The commands that end, name, find and split a conversation. /clear, /resume, /branch and /rename inside, and --name, --resume and --from-pr at launch.

**Course:** [Claude Code Commands](https://learn.benibix.com/learn/ai-claude-code-commands)  
**Time:** 11 min

**After this lesson you can:**

- Name a session so you can find it later
- Split a chat with /branch to try an idea
- Find the session that wrote a pull request

## How to end, name, find and split a conversation

Every Claude Code conversation is saved to disk, so it can be found again. Inside a session, /clear starts a new one and keeps the old, /resume opens an old one, and /branch splits the one you are in. In the shell, claude --resume, or -r, does the job of /resume. A name of up to 200 characters makes all of them easier.

/clear empties the chat so Claude starts fresh on a new task. CLAUDE.md and your project memory load again. Pass a name, such as /clear login-fix, and the old chat gets that label in the /resume list. /reset and /new are other names for it. /exit, or /quit, closes Claude Code, and the chat stays on disk.

Names are how you find things. claude -n login-fix starts a session with a name, and the name shows in the /resume list and the terminal title. /rename changes it in the middle of a session and puts it on the prompt bar. With no name, /rename makes one up from the chat.

/resume with no name opens a list of past sessions, and background ones are marked bg. With a name or an ID, it opens that one at once. /continue is another name for it. Given an ID, claude --resume looks in this project and its worktrees first, then in every other project on the computer.

A script wants an ID it knows ahead of time. --session-id starts a session with one you pick. It must be a UUID, a long code in a fixed pattern of letters and numbers. The script can then resume that exact session later without reading any list. A person is better served by a name.

/branch copies the chat at this point and moves you into the copy. The original stays as it was, and /resume takes you back to it. Both copies work on the same files. So a branch tries a new line of talk, not a new set of edits. --fork-session does the same when you resume from the shell.

--from-pr finds sessions by the pull request they worked on. Give it a number, or a link from GitHub, GitLab or Bitbucket. When Claude opens a pull request, the session is linked to it on its own. So a review comment three weeks later can lead straight back to the chat that wrote the code.

```bash
claude -n login-fix
claude --resume login-fix
claude --from-pr 123
claude --session-id "550e8400-e29b-41d4-a716-446655440000"
```
Start with a name and come back by it. Find the chat behind a pull request, or set an ID for a script.

![Two columns. When you start, claude -n login-fix sets a name and claude --session-id with a UUID sets an ID. When you come back, claude --resume login-fix or claude --from-pr 123 finds the session again. Notes say a name is for you and a UUID is for a script, and that --resume alone shows a list.](https://learn.benibix.com/diagrams/flag-find-session.svg)

### Example: Emma tries a second idea in one chat

Emma has spent 40 minutes on a slow page with Claude. She wants to test a cache idea without losing the thread, so she runs /branch try-cache.

The idea fails. She runs /resume and picks the original, and all 40 minutes of talk are there. The cache edit is still in her files, since both chats share them, so she undoes it with git.

**Words in this lesson:** [/clear Command](https://learn.benibix.com/term/ai/clear-command), [/exit Command](https://learn.benibix.com/term/ai/exit-command), [--name Flag](https://learn.benibix.com/term/ai/name-flag), [/rename Command](https://learn.benibix.com/term/ai/rename-command), [/resume Command](https://learn.benibix.com/term/ai/resume-command), [--resume Flag](https://learn.benibix.com/term/ai/resume-flag), [--session-id Flag](https://learn.benibix.com/term/ai/session-id-flag), [/branch Command](https://learn.benibix.com/term/ai/branch-command), [--from-pr Flag](https://learn.benibix.com/term/ai/from-pr-flag)

**Question:** You run /branch, edit a file in the copy, then /resume the original. Where is the edit?

**Answer:** Still in the file, since both chats share the same files. /branch copies the conversation, not the files. Both chats work on the same folder, so an edit made in one is there in the other.

---

Source: https://learn.benibix.com/learn/ai-claude-code-commands/resume-branch-and-rename
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-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
