[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.
44 Comments
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
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?
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.
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:
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-hedgineer<https://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:
Does this capture what we need for the basic session naming feature?
β
Reply to this email directly, view it on GitHub<https://github.com/anthropics/claude-code/issues/2112#issuecomment-2985713325>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A6QOOYPBRQ4QNGN3HBPU5NL3EHJFBAVCNFSM6AAAAAB7LJDEW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOBVG4YTGMZSGU>.
You are receiving this because you were mentioned.Message ID: @.***>
Michael Watson
@.****@.**>
hedgineer.io<https://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 likeOh that's not the right one!Image
@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
/statusnow 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
claudecommand 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 --continueisnt' the default is wild. It should beclaude --neworclaude --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 --
<img width="901" height="524" alt="Image" src="https://github.com/user-attachments/assets/b38a79c6-481a-48cd-af41-e1128e768bac" />
Install using
uv tool install claude-code-tools.Besides this you'll get the
tmux-clitool as well, recently discussed in HackerNewsI 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
directorybut hard to tell what the session was used for....<img width="1846" height="953" alt="Image" src="https://github.com/user-attachments/assets/10e78ef9-8598-44f3-8710-07c1f7f91895" />
+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.
<img width="1535" height="39" alt="Image" src="https://github.com/user-attachments/assets/138f356a-b4d0-4758-b3dc-257d0d4b3715" />
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.
SessionStarthook obtains the session ID and writes it as an env var inCLAUDE_ENV_FILE/session-name [name]saves the ID with the name ($ARGUMENTS)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
/titleslash 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 runclaudeand 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
Getting an error when installing
Hi @tommdq, I think it's because you're using an older version of CC I didn't test with. I'll take a look and see if it's simple to add compatibility for that version. (Let's move the conversation here: https://github.com/Piebald-AI/tweakcc/issues/204.)
@bl-ue tweakcc looks awesome, but it would be even better if it worked within the Claude Code for VS Code extension, and for an existing conversation that you have already opened with
claude --resume. Could you maybe look into supporting these when you get a chance?Feature Request: Session Lifecycle Management & Project Configuration
## Problem Statement
Issue #2112 ([Feature Request] Add --session-name and /session-name for custom session identification)
excellently covers session naming. However, there are still gaps in the complete session lifecycle:
~/.claude/sessions/<guid>/folders## Proposed Features
### 1. Session Deletion Command
Syntax:
```bash
# Delete by GUID
claude session delete <session-id>
# Delete by name (if #2112 is implemented)
claude session delete --name "refactoring auth"
# Interactive deletion with confirmation
claude session prune
# Lists all sessions with last modified date
# Prompts: "Delete sessions older than 30 days? [y/N]"
# Dry-run mode
claude session delete <session-id> --dry-run
```
Features:
Use case: Currently ~10 sessions, hard to identify which to keep. Need safe cleanup.
---
### 2. Git Branch Integration
Syntax:
```bash
# Auto-associate new session with current branch
claude --branch
# Reads git branch, stores in session metadata
# Show sessions for specific branch
claude session list --branch feature/auth
# Auto-switch branch when resuming
claude --resume --switch-branch
# If session was on feature/auth, runs: git checkout feature/auth
```
Metadata stored in session:
{
"session_id": "a1b2c3d4...",
"name": "Auth refactoring",
"git": {
"branch": "feature/auth-refactor",
"commit": "abc123def",
"repo": "local:user/repo.git" | "git@github.com:user/repo.git"
}
}
Use case: Working on 3 features in parallel with time sharing. Each has dedicated branch + session. Need to map them.
---
### 3. Project-Level Configuration (.clauderc)
Concept: Per-project settings file (like .gitignore, .editorconfig)
Location: <project-root>/.clauderc (YAML or JSON)
Example .clauderc:
``
bash
``# Claude Code project configuration
project:
name: "Super site creating system"
session:
```bash
# Auto-naming pattern for new sessions
naming_pattern: "${project}-${branch}-${date}"
# Result: "SuperSite-feature/site222-20331225"
# Auto-associate with git branch
git_integration: true
# Default model for this project
default_model: "sonnet"
```
tools:
```bash
# Pre-approved tools (no user confirmation needed)
auto_approve:
```
```bash
# Always require approval
require_approval:
```
files:
```bash
# Files to exclude from context (like .gitignore)
exclude:
```
mcp:
```bash
# Project-specific MCP servers
servers:
command: "python"
args: ["tools/mcp_server.py"]
```
Benefits:
Use case:
---
## Implementation Priority
#### High priority:
#### Medium priority:
#### Nice to have:
---
## Backward Compatibility
---
## Related Issues
---
## Summary
This feature request extends #2112 by adding:
Together with #2112's naming features, this creates a complete session management solution.
+1
While this doesn't land on main CLI, feel free to check out this lil wrapper I released recently: https://github.com/fgrehm/clotilde. It has support for naming chats and also for forking
Yes please!!
it seems to me this is now a problem with 100 acceptable solutions. i attempted to organize a forum for people to agree on a consensus-approved community solution until an official one is provided, but was unsuccessful. i'm pretty confident that if you have a specific need that isn't already addressed somewhere in this thread, it wouldn't be that hard for Claude to write you your own customized solution probably in one shot. it was able to do so for me when i asked it, anyway. π€·π½ββοΈ
+1 for this feature, especially the compaction persistence aspect.
My use case: Long sessions that undergo multiple
/compactcycles lose their original context entirely. After several hours of work on "DayStatusType integration", the session summary becomes "deployed frontend and backend" - completely losing the original project scope.The session name surviving compaction (as proposed in point 4) would solve this. Currently I work around it with plan files and branch names, but native session naming would be much better UX. Flexibility to rename sessions manually at any point of the interaction would be really useful.
It looks like this was added in 2.0.64:
I'm running
Version: 2.0.64but still doesn't work:Unknown slash command: renameThank you for the feedback! We now support /rename <name> in the latest version.
@catherinewu please don't close this thread, it's like a second home for some of us. β€οΈ π€£
Just joking, thanks for adding this in to the product. ππ½
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.