Skip to content
BENIBIX Learn

--name vs --session-id

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.

AI⌨️ Claude Code

--name Flag

It gives a new session a name you choose.

--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.
Why it matters
A name is easy to remember and type. A long ID is not.
Full entry
AI⌨️ Claude Code

--session-id Flag

It starts a session with an ID you choose.

--session-id starts a session with an ID you choose, not one Claude Code makes up. The ID must be a UUID, a long code of letters and numbers in a fixed shape. A script uses it to know the ID up front, so it can resume or look up that exact session later.

Example
Emma's script makes a UUID, saves it with the job, then runs claude -p with that --session-id. The next day it resumes the same session by the saved ID.
Why it matters
A script can find its own sessions later without reading a list or guessing.
Full entry

In one line

--name Flag
It gives a new session a name you choose.
--session-id Flag
It starts a session with an ID you choose.