[BUG] session started with `--name` CLI flag does not show the session name in the top right corner of the prompt box

Status Fixed / completed
Reported on v2.1.75
Maintainer reply ✓ Yes — ashwin-ant
Activity 6 comments · opened Mar 14, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

As 2.1.75, when the session name is set via /rename command, I can see the top-right label in the prompt box:

<img width="712" height="147" alt="Image" src="https://github.com/user-attachments/assets/a2de322c-2b53-4bed-a806-b371e15875be" />

_BUT_ when I start a session with --name CLI flag (which is added in 2.1.76), it the label doesn't appear.

What Should Happen?

The session name should be displayed regardless of how the session name is set.

Error Messages/Logs

Steps to Reproduce

  1. Start a session with claude --name foobar
  2. "foobar" is not displayed in the top right corner.

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

6 Comments

yurukusa · 5 months ago

Workaround

After starting with --name, run /rename with the same name to force the UI label:

claude --name my-session
/rename my-session

The --name flag sets the session name internally but doesn't trigger the UI label rendering. /rename triggers the full UI update.
Alternatively, use --resume with a name (which combines naming + display):

claude --resume my-session
gudzilla · 4 months ago

This is sad...
I need this flag to work. For my launch aliases.

I can't start sessions with my new names that I assigned to

  • Opus as "BIG BOY OPUS: MASTER PLANNER"
  • and Sonnet as "LITTLE SONNET: EXECUTOR"

it's simply not workin

alias claudeop='claude --model opus -n "BIG BOY OPUS: MASTER PLANNER"'
alias claudeson='claude --model sonnet -n "LITTLE SONNET: EXECUTOR"'

_Valve, pls fix_

barries · 4 months ago
  • 1 this is biting me too.
jarrah-anthropic · 4 months ago

Thanks for the report — fixed, will be in the next release. --name will show in the prompt-box banner on startup and persist across --resume.

ashwin-ant collaborator · 4 months ago

This was fixed in v2.1.113 — Sessions started with --name now show the session name in the prompt-box banner immediately on startup and after --resume. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.