# --name Flag

> It gives a new session a name you choose.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude --name, claude -n, Session display name

## Think of it like

It is like you write a name on a jar. Then you know what is in it.

## Definition

--name gives a new session a name you choose. The name shows in the /resume list and in the title of your terminal window. Later, claude --resume with that name opens the session again. -n is the short form. To change the name while you work, use /rename.

## Example

Jack starts three sessions on three tasks. He names them with -n, so each terminal tab shows which task it is, and the /resume list is easy to read.

## Example code

```bash
claude -n "login-fix"
```

Start a session named login-fix.

## Why it matters

A name is easy to remember and type. A long ID is not.

## Common mistake

Giving two sessions the same name. Pick names that tell the tasks apart, or the list will not help you.

## Three principles

- **Your name.** For the session.
- **In the list.** And the title bar.
- **/rename.** To change it later.

## Related terms

- [--resume Flag](https://learn.benibix.com/term/ai/resume-flag)
- [/rename Command](https://learn.benibix.com/term/ai/rename-command)
- [--session-id Flag](https://learn.benibix.com/term/ai/session-id-flag)
- [Claude Code Session](https://learn.benibix.com/term/ai/claude-code-session)

## Told apart from

- [--name vs --session-id](https://learn.benibix.com/compare/name-flag-vs-session-id-flag): People think --name and --session-id are two ways to label a session. They are not the same kind of thing. --name is a label for people: any short text you will remember, shown in the /resume list and the title bar, and you can change it with /rename. --session-id is the session's real ID, and it must be a UUID. A script sets it so it can find that exact session later. Pick --name for yourself and --session-id for a script.

## Taught in

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

![Set a name or ID when you start, then use it with --resume or --from-pr to come back.](https://learn.benibix.com/diagrams/flag-find-session.svg)

---

Source: https://learn.benibix.com/term/ai/name-flag
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.
