[Feature Request] Add --session-name and /session-name for custom session identification
π€ Beep boop! This issue was co-authored by an AI assistant (that's me!) and a human who's tired of playing "guess the session" roulette π°
Problem Description
Currently, Claude Code sessions are only identifiable by auto-generated session IDs and timestamps. When using claude --resume to view previous sessions, it's difficult to identify which session contains the work you're looking for, especially after days or weeks. The auto-generated summaries are helpful but often insufficient for distinguishing between similar coding sessions.
This issue is related to #1407 (session ID retrieval) and #1335 (session identification challenges), but focuses on making sessions human-readable rather than just exposing technical IDs or auto-generated summaries, as users may want to use their own keywords etc.
Proposed Solution
Add the ability to assign custom names/descriptions to sessions for easier identification and retrieval.
1. Command-line flags for new sessions:
# Start a new session with a descriptive name
claude --session-name "refactoring auth system"
# With initial prompt
claude --session-name "fixing payment bug #234" "investigate the stripe webhook issue"
# Alternative flag name (if preferred)
claude --session-comment "working on user dashboard redesign"
2. Interactive command for active sessions:
# During an active session
/session-name refactoring auth system
# Or to update existing name
/session-name updated: auth system + oauth integration
3. Enhanced resume interface:
Current behavior:
$ claude --resume
βββββββ¬βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββ
β No. β Last Update β Summary β
βββββββΌβββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββ€
β 1 β 2025-01-15 14:32:00 β Working on file editing and bug fixes β
β 2 β 2025-01-15 09:15:00 β Implementing new features for API β
β 3 β 2025-01-14 16:45:00 β Debugging test failures β
βββββββ΄βββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββ
Proposed behavior with session names:
$ claude --resume
βββββββ¬βββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββ
β No. β Last Update β Session Name β Summary β
βββββββΌβββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββ€
β 1 β 2025-01-15 14:32:00 β refactoring auth system β Working on file editing and bug fixes β
β 2 β 2025-01-15 09:15:00 β stripe webhook fix β Implementing new features for API β
β 3 β 2025-01-14 16:45:00 β [unnamed] β Debugging test failures β
βββββββ΄βββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββ
4. Integration with existing features:
- Include session name in
/statusoutput (addresses #1407) - Preserve session name in
/compactsummaries (#269) - Show session name when using
--continueto confirm correct session - Allow searching/filtering by session name:
claude --resume --search "auth"
Implementation Considerations
- Storage: Session names should be stored alongside existing session metadata
- Length limits: Suggest max 100 characters for session names
- Special characters: Allow alphanumeric, spaces, dashes, underscores
- Backwards compatibility: Sessions without names show as "[unnamed]" or use auto-summary
Benefits
- Dramatically improves session discoverability
- Reduces time spent searching for the right session to resume
- Better project organization for long-running development tasks
- Complements session ID functionality rather than replacing it
Related Issues
- #1407 - Session ID retrieval (this feature would make IDs less critical)
- #1335 - Session identification after compaction
- #1340 - Enhanced session resumption
- #269 - Saving compact summaries (could include session names)
Alternative Approaches Considered
- Auto-generating names from first prompt (too limiting)
- Using git branch names (not all sessions are git-related)
- Mandatory names (would break existing workflows)
Would love feedback on the flag naming (--session-name vs --session-comment vs other options) and whether both CLI flag and interactive command are needed.
I like how you make the "name" of the session more easily discoverable but we should make this the case for the Session ID as well as i don't want to lose that. Currently the only way I am aware of getting the session ID is programmatically looking through the messages. However I wouldn't want to use the "name" as a primary key for the session, and instead just treat this as an alias for humans. You need to prevent name collisions and a human needs to set it and it could get messy. But keeping as an option.
In that case change the No. column to actually be the ID and nuke the concept of a number (not that helpful). So if you add this have the columns be:
Session ID, Last Updated, Name, Description
@michael-hedgineer
- π― Session ID visibility and easy to get it super important!
To me adding note/description is just a helper, to get session id later and use it later via session id.
E.g. one can imagine putting "tags" in session name/commnent, then via "tags" retrieve lists of session ids that maybe relevant etc... basically I just see both things playing well with each other like UNIX KISS lego blocks.
thanks for this input. would you still want auto-summarization as well?
thanks for this input. would you still want auto-summarization as well?
I see value in having both , as separate columns / separate json output fields.
I would personally use this notes section to put "tags" "keywords" not real descriptions, so I could "grep by them", while auto summarization as "human take a look" nice to have of course!
It is medium useful however in practice I have so many sessions that it is a bit difficult to decifer through which is which in a large description. Just a name similar to a branch in git would be more helpful as there is less entropy. I am wrapping the claude sdk in a python sub process, exposing as a web socket, and running withing a task queue so the summary is not as helpful for this.
Any plans for making this meta data storage option available outside to the local machine? Currently we have to store the outputs of of json-stream, session ids, and prompts within our own internal store to get around this but would be nice if you supported this natively.
Any plans for making this meta data storage option available outside to the local machine?
If we get CLI/SDK access to metadata (summary, session ID, notes) in text/JSON formats, you could export it anywhere. @michael-hedgineer - remote storage/sync deserves its own issue/discussion thread.
Let's refocus here on the core feature: adding name/description fields to sessions for better local organization. The key decisions seem to be:
- Column order: Session ID, Last Updated, Name, Description
- Keep both manual notes AND auto-summary as separate fields
- Make Session ID easily visible (not just programmatic access)
Does this capture what we need for the basic session naming feature?
Sounds good to me!
From: Grzegorz Wierzowiecki @.> Sent: Wednesday, June 18, 2025 10:14:56 PM To: anthropics/claude-code @.> Cc: Michael Watson @.>; Mention @.> Subject: Re: [anthropics/claude-code] [Feature Request] Add --session-name and /session-name for custom session identification (Issue #2112)
[https://avatars.githubusercontent.com/u/221403?s=20&v=4]gwpl left a comment (anthropics/claude-code#2112)https://github.com/anthropics/claude-code/issues/2112#issuecomment-2985713325
Any plans for making this meta data storage option available outside to the local machine?
If we get CLI/SDK access to metadata (summary, session ID, notes) in text/JSON formats, you could export it anywhere. @michael-hedgineerhttps://github.com/michael-hedgineer - remote storage/sync deserves its own issue/discussion thread.
Let's refocus here on the core feature: adding name/description fields to sessions for better local organization. The key decisions seem to be:
- Column order: Session ID, Last Updated, Name, Description
- Keep both manual notes AND auto-summary as separate fields
- Make Session ID easily visible (not just programmatic access)
Does this capture what we need for the basic session naming feature?
β Reply to this email directly, view it on GitHubhttps://github.com/anthropics/claude-code/issues/2112#issuecomment-2985713325, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A6QOOYPBRQ4QNGN3HBPU5NL3EHJFBAVCNFSM6AAAAAB7LJDEW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOBVG4YTGMZSGU. You are receiving this because you were mentioned.Message ID: @.***>
Michael Watson
@.@.>
hedgineer.iohttps://www.hedgineer.io
H E D G I N E E R
I would find it really useful if i could do something like this claude --continue --session-name $(git branch) and it would either start a new session OR continue the latest session with that name.
Just wanted to say that I too have been looking for this feature. Sessions become impossible to find after just a few hours of heavy usage with multiple sessions.
It also doesn't help that once resumed, summaries appear to change into This session is being continued from a previo... forcing me to go into each session to be like Oh that's not the right one
@gwpl are those real outputs? side issue - but i notice the dates are referring to January... which is something i catch it doing all the time...
also, i don't remember when this was added, but session IDs are visible mid-session with /status now fwiw, i know that's not the main problem ppl are discussing. (also I think they're in hook outputs but i can't remember)
+1 for this feature request. Became an absolute necessity within 1 day of starting to use Claude Code.
@gwpl perfect spec for this feature + ability to resume session by name from claude command line.
IMHO no need to enforce name uniqueness; resolve to most recently updated if multiple exist (to access older same named session, use session-ID).
I also really want this feature, just like it's described. Hope it gets added soon.
Yes Please!
Slightly relatedβwould love to be able to merge, consolidate, purge sessions. The fact that claude --continue isnt' the default is wild. It should be claude --new or claude --new-session, but I digress, and distract from your feature request (which I support!) ππΌ
May be useful for someone -- I built this simple claude session finder that finds claude sessions by keyword, either for the current project, or globally, and provides a UI to select the session to resume, and auto-switches to the project if needed:
https://github.com/pchalasani/claude-code-tools?tab=readme-ov-file#-find-claude-session
Looks like this --
Install using uv tool install claude-code-tools.
Besides this you'll get the tmux-cli tool as well, recently discussed in HackerNews
I would also love the possibility to rename/describe sessions because at the moment my top 3 recent chats are identically described as "This session is being continued from a previo..."
Would also love if the sessions were visible on claude.ai and all conversations were available from all Claude Code installations.
Rename a session is critical when multiple agents are working on the same project.
yes please add, would love this to be added to the session status JSON as well. so that I can tell what claude session is doing...
Also be cool to start a session with the name...
Image shows the same directory but hard to tell what the session was used for....
+1 for this, super important from my POV. also, i often see these kind of hallucinated session summary: "Debugging Python Script for Data Processing", for session that obviously had nothing to do with that summary.
Wen?
Could we get a status on if this is going to be addressed at all?
With all the duplicates floating around and the bot closing them every three days, is this indeed the DE FACTO Feature request for naming and visualizing sessions?
+1 on this. I don't understand how this hasn't been addressed yet. My /resume list is full of " This session is being continued from a previoβ¦" which is useless.
+1 - i'm seeing lots of This session is being continued from a previous conversation that ran out of context. in my resume menu and other generic titles
+1
please address this!
Hey yall, I've been getting notifications on this Issue for a long time... I'm inviting the community to get together and build the right solution ourselves - I want to do it by organizing a "Feature Bounty" friendly competition (with cash prize) over on my Claude Code repo. I want to organize it in a fun, collaborative way, and we need your participation (as a user, developer, reviewer) in order to make it happen. Check out the announcement and let me know if you're interested!
+1
Right now, it's very complex to find the correct session when you have dozens of sessions throughout the day
I wondered if this could be done with hooks and custom slash commands, and it's doable. AFAICT, it needed a wrapper to add the CLI argument(s), so I implemented that too.
If anyone wants to try, or do more, it's here with instructions and notes.
- the
SessionStarthook obtains the session ID and writes it as an env var inCLAUDE_ENV_FILE - a custom slash command,
/session-name [name]saves the ID with the name ($ARGUMENTS) - a Python wrapper around
claudeadds--session-name [name]and--resume [name], and stores pairs in SQlite. It lacks any UI, menu, etc.
I think it wouldn't take much more to make it a plugin.
I likely won't use it, since the external implementation has a few drawbacks. Also, the native resume menu with / has been adequate for me.
I'd still appreciate a native feature though. (Or, allow deeper extension of claude with custom command line options and non-model custom-slash commands.)
Great idea! I'd also add the session name on terminals tabs (regular terminals+ vscode terminals)
Hello everyone! I'm the maintainer of tweakcc, an automated patcher/customizer for Claude Code. (It adds a bunch of features like system prompt customization, toolsets, theme customization, etc.) I just added a feature that adds a /title slash command to Claude Code that you can use to manually name your sessions.
If you'd like to try it, all you need to do is run npx tweakcc --apply. Then run claude and use the slash command like this: /title fixing payment bug #234. Here's a demo video:
https://github.com/user-attachments/assets/e37b162a-0c81-4252-9adf-e812a9b7df6a