Feature Request: Add session_name to statusline JSON data

Resolved 💬 19 comments Opened Dec 22, 2025 by darioluanne770968-prog Closed May 18, 2026
💡 Likely answer: A maintainer (claude[bot], contributor) responded on this thread — see the highlighted reply below.

Feature Request

Description

Currently, the statusline script receives JSON data that includes session_id (UUID) but does not include the user-defined session name set via the /rename command.

Current Behavior

The JSON passed to the statusline script contains:

{
  "session_id": "e8939c9b-3a20-46d3-8803-cda5e658ecdf",
  "model": {...},
  "cost": {...},
  "workspace": {...},
  ...
}

Requested Behavior

Please add a session_name field to the JSON data:

{
  "session_id": "e8939c9b-3a20-46d3-8803-cda5e658ecdf",
  "session_name": "my-project-session",  // <-- Add this field
  "model": {...},
  "cost": {...},
  "workspace": {...},
  ...
}

Use Case

Users who rename their sessions with /rename would like to display the friendly session name in their custom statusline. This helps identify different sessions when working on multiple projects.

Example Usage in statusline.sh

SESSION_NAME=$(echo "$input" | jq -r '.session_name // .session_id')
echo "📝 $SESSION_NAME | 🤖 $MODEL_DISPLAY | ..."

Environment

  • Claude Code version: 2.0.75
  • OS: macOS

Thank you for considering this feature!

View original on GitHub ↗

19 Comments

geetashinde0084-crypto · 6 months ago

{
"session_id": "e8939c9b-3a20-46d3-8803-cda5e658ecdf",
"model": {
"name": "example-model",
"version": "1.0"
},
"cost": {
"total": 0.05,
"currency": "USD"
},
"workspace": {
"id": "ws-12345",
"name": "My Workspace"
}
}

okets · 6 months ago

+1 (opened a similar request, i will close it)

idarthjedi · 6 months ago

+1 went to open a similar feature request, and found this one!

benjamin-benz-42 · 6 months ago

+1 was about to open a request as well

adamcbrewer · 5 months ago

+1, very useful to have this for multi-claude sessions

not-an-llm · 5 months ago

Same, very useful when managing multiple sessions

litanli · 5 months ago

+1 would love this feature

jeremych1000 · 5 months ago

Would love this, feels like a straightforward implementation! Much more friendly to the eyes than a UUID.

yulonglin · 5 months ago

It's implemented in 2.1.39! I haven't checked if it's in the statusline metadata, but it shows up in Claude Code when you rename the session :)

<img width="1778" height="344" alt="Image" src="https://github.com/user-attachments/assets/28a90c36-0bd8-404f-ae01-cedf4240b0a4" />

Niels-LNS-Research · 5 months ago

+1
I cannot stress how important it is to implement this feature. CC has a way to set the session name, but no way to read it. As a minimum there should be a /name command in addition to the /rename command.
It is so easy to get lost when having multiple sessions open. This feature would bring back some sanity.
I would be surprised if this was difficult to implement compared to all the other awesome features we have.

Niels-LNS-Research · 5 months ago
It's implemented in 2.1.39! I haven't checked if it's in the statusline metadata, but it shows up in Claude Code when you rename the session :) <img alt="Image" width="1778" height="344" src="https://private-user-images.githubusercontent.com/30549145/548049736-28a90c36-0bd8-404f-ae01-cedf4240b0a4.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzA5MTY3MDIsIm5iZiI6MTc3MDkxNjQwMiwicGF0aCI6Ii8zMDU0OTE0NS81NDgwNDk3MzYtMjhhOTBjMzYtMGJkOC00MDRmLWFlMDEtY2VkZjQyNDBiMGE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMjEyVDE3MTMyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBhMzUwZGVlNTYwMTE1ZTlhMDQ4NDMzYjI3ODU5YTVjYTUyYzU0ODM2N2ExZmM2MDI4NTlmOWNkMTk4NTkzMzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3HOTa762qBv-v5EQkl4tYnObdtt13kXOITOLEfgxloo">

I cannot see it. Running CC from PowerShell:

<img width="1656" height="250" alt="Image" src="https://github.com/user-attachments/assets/9fe9618b-f6cb-4d77-9a9f-27d33293f3ff" />

zzJinux · 5 months ago

I confirmed that in v2.1.42 the session_name key appears when a session becomes named though not documented yet in https://code.claude.com/docs/en/statusline#available-data.

jeremych1000 · 5 months ago
I confirmed that in v2.1.42 the session_name key appears when a session becomes named though not documented yet in https://code.claude.com/docs/en/statusline#available-data.

Also not in https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2142

tomarshall · 4 months ago
I confirmed that in v2.1.42 the session_name key appears when a session becomes named though not documented yet in https://code.claude.com/docs/en/statusline#available-data.

Currently on 2.1.72, can't find session_name anywhere.

jeremych1000 · 4 months ago
> I confirmed that in v2.1.42 the session_name key appears when a session becomes named though not documented yet in https://code.claude.com/docs/en/statusline#available-data. Currently on 2.1.72, can't find session_name anywhere.

It works though, try and just echo the input you get in your statusline after running /rename and you'll see it.

Docs aren't updated.

speti4 · 4 months ago

+1 — would use this in a custom statusline script to identify sessions at a glance.

rcorre · 3 months ago

@jeremych1000 and @zzJinux are correct. session_name is in the JSON, but _only_ if your session is explicitly named, and it is not documented. So I think the ask here would just be to document it.

claude[bot] contributor · 1 month ago

This issue was fixed as of version 2.1.42.

github-actions[bot] · 8 days 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.