Omniscio

OmniscioGuidesRename a Claude Code session

How to name and rename a Claude Code session

Claude Code never gives a session a name you chose, and it gives every unnamed session two labels of its own. That is why a session can look named, and still not be found by the name on screen: only one of those two labels is a handle you can resume with.

Naming is worth the ten seconds when you run several tasks in parallel, which is when it matters most. The resume guide covers what a resumed session restores; this page covers the name itself.

Checked against Anthropic's Claude Code documentation on November 25, 2026. By the Omniscio team. Updated .

The ways to name a session

Three routes in the terminal set a name, and one of them reaches a session that already ran. The list is Anthropic's own, and the difference between the first two is only when the name lands.

  • At startup: claude -n auth-refactor. The name exists before the first prompt, so the session is resumable from the moment it opens, and the CLI reference says it shows in /resume and in the terminal title.
  • During a session: /rename auth-refactor. This is the one you can run without losing your place in the conversation.
  • From the session picker: highlight a session and press Ctrl+R to rename it. This is the only terminal route that renames a session you are not inside.

Two more routes come from outside the terminal. Renaming a Remote Control session from claude.ai or the Claude app applies the same name in the CLI, on v2.1.221 or later, and the desktop app has its own rename in its session list.

Once a name is set through a CLI route or from claude.ai, it is the handle for everything that follows: the label on the picker row and the argument to claude --resume. The picker is covered below, because it is where you will read and change names most often.

The picker, since that is where names are read

Run /resume inside a session, or claude --resume with no arguments, to open the picker. The keys worth knowing before you rename anything:

  • Ctrl+R renames the highlighted session; Space previews its content without opening it.
  • Ctrl+A shows sessions from all projects on the machine, and pressing it again returns to the current repository.
  • Ctrl+W shows all worktrees of the current repository, and Ctrl+B filters to the current git branch.
  • Any printable character other than Space, j or k starts a search. Pasting a GitHub, GitHub Enterprise, GitLab or Bitbucket pull or merge request URL finds the session that created it.

Each row is labelled with the first of these that exists: the name you set, the generated title, a conversation summary, or one of your prompts. That order is the reason a named session is easier to find later than a well-scrolled one.

Resuming by name

Both forms resolve a name, and both look for an exact match first. claude --resume <name> is the shell command; /resume <name> is the same lookup from inside a running session.

A name resolves across the current repository and its worktrees, so a session whose worktree lives somewhere else in the repository is still reachable by the name you gave it. A worktree is a fresh checkout of the same repository, which Claude Code creates so an agent can edit in isolation from your working copy.

The case worth knowing is an ambiguous name, when more than one session holds it:

  • claude --resume <name> opens the session picker with the name pre-filled as a search term, so you choose from the matches.
  • /resume <name> reports an error instead. Run /resume with no argument to open the picker and pick there.

A session you never named still has a caption, and the next section is about why that caption will not open it.

The two labels Claude Code assigns

An unnamed session gets two labels, and only one of them resumes anything.

The default display name

Every interactive session you never name gets a default display name when it starts, built from the working directory's name plus a two-character suffix, for example my-app-3f. It identifies the session in listings of running sessions such as agent view and claude agents --json. It is not a resume handle: pass it to claude --resume or /resume and Claude Code does not find the session.

The generated title

A session you do not name also gets a generated title: a short summary of your first prompt, written by a background request to the small, fast model, normally a Haiku-class one. That title is a handle. You can pass it to claude --resume or /resume and Claude Code resolves it the same way as a name you set.

Two edges are worth knowing. A claude -p run started straight from a shell or a script does not get a generated title at all. And setting CLAUDE_CODE_DISABLE_TERMINAL_TITLE to 1 stops terminal and Agent SDK sessions getting one, which is fine if you name your sessions and a trap if you were relying on the title.

Accepting a plan in plan mode is another way a title arrives: it gives the session a generated title based on the plan, unless you have already named it. Because that replaces the earlier title, a session can change its own handle mid-life. Either title resolves, so the change costs you nothing except the surprise of a picker row that reads differently.

Names and /clear

Clearing context does not have to lose the name. With no argument, /clear keeps a name you set with --name or /rename, but not an AI-generated title, so the new session starts unnamed if the old one was only titled.

To name the session you are leaving instead, pass the name: /clear release-prep names the outgoing session and the new one starts unnamed. That is the opposite of what most people expect, and it is worth knowing before you clear a long session you meant to keep.

The old conversation is not deleted either way. It stays resumable through /resume, or through the rewind menu's previous-session entry in the same Claude Code process. The deletion guide covers what actually removes it from disk.

Sources

Every factual line above rests on these three pages of Anthropic's documentation, read on November 25, 2026.

  • Manage sessions, for the naming routes, resume by name and its ambiguity, the default display name against the generated title, the /clear naming behaviour, and the picker's keys.
  • CLI reference, for the --name and -n flag, what it sets, and where the name shows.
  • Explore the .claude directory, for the one line that defines a worktree as a fresh checkout.

No session was renamed for this page. Every command, key and version floor is transcribed from those pages.

Common questions

How do I rename a Claude Code session?

Run /rename auth-refactor during the session, or highlight the session in the picker opened by /resume and press Ctrl+R. The name becomes the handle you resume with, and the label on the picker row. To name a session before it starts, launch it with claude -n auth-refactor.

How do I resume a session by name?

Run claude --resume <name> from the shell, or /resume <name> inside a session. Both look for an exact match and resume it directly, even in another worktree. An ambiguous name behaves differently: claude --resume opens the picker with the name pre-filled as a search, while /resume <name> reports an error and you run /resume with no argument.

Why does claude --resume not find my session by its displayed name?

The label you see may be the default display name, which combines the working directory's name with a two-character suffix such as my-app-3f. It identifies the session in listings of running sessions but is not a resume handle. The AI-generated title is a handle; the default name is not.

Does a session keep its name after /clear?

Yes, if you set the name with --name or /rename. With no argument, /clear keeps a name you set but not an AI-generated title. To name the session you are leaving instead, pass the name: /clear release-prep, and the new session then starts unnamed.

Every session, named and in one window

Omniscio keeps every agent session in one list with the name, project and status on the row, so the one you resume is the one you meant. Claude Code, Codex, OpenCode, Devin, Pi and Hermes all supported.