-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
🤖 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 integration3. 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 [Feature Request] Add session ID retrieval command for interactive sessions #1407) - Preserve session name in
/compactsummaries (Feature request: save session summaries from /compact #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
- [Feature Request] Add session ID retrieval command for interactive sessions #1407 - Session ID retrieval (this feature would make IDs less critical)
- How to get session ID from interactive session? #1335 - Session identification after compaction
- Feature Request: Session Resumption for Claude Code CLI #1340 - Enhanced session resumption
- Feature request: save session summaries from /compact #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.