[FEATURE] Add `/list-sessions` and `/delete-session` slash commands for better session management
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 9 comments · opened Jan 8, 2026 · closed Mar 16, 2026
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Title: [FEATURE]
Description:
Currently, there's no convenient way to view or delete sessions without using claude --resume. This creates two UX problems:
- No way to list sessions without resuming -
claude --resumeforces an interactive selection interface. Users who just want to see their session history must navigate through the interactive menu.
- No way to delete sessions - There's no CLI command or slash command to delete a specific session by ID. While
claude --resumeclearly has access to the session file paths (since it can list them), there's no corresponding delete functionality.
Possible duplicate issue #13780
Proposed Solution
Add two slash commands that mirror standard session management workflows:
/list-sessions # Lists all previous sessions with ID, timestamp, and initial prompt
/delete-session <id> # Deletes a specific session by ID
Or alternatively, extend the CLI:
claude --list-sessions
claude --delete-session <session-id>
Why this matters:
- Users want to audit their session history without being forced into resume mode
- Session cleanup should be straightforward (currently requires manual directory navigation)
- This would make Claude Code's session management more consistent with standard CLI tools
- The session storage location is already known to the application
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
As a developer, I want to review my past sessions, identify ones I no longer need, and delete them without navigating ~/.claude/projects/ manually or using --resume in an unintended way.
Additional Context
_No response_
9 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
The linked duplicate issues are both closed. Therefore, I cannot 👍 / 👎 to them.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
How is it possible that this is not a thing yet?
I just added integration tests for my custom hooks, using
claude -pto execute the tests and confirm hook behavior.And it works! But now when I run
claude --resumethe session list is cluttered with my tests... :(There is probably a work-around for this, but the ability to delete "junk" sessions would be great.
@noahlz 100% this bit me until I learned about the
--no-session-persistenceflag to be used along with-pBuilt a wrapper that adds the features requested here plus more. Reference implementation: https://gist.github.com/zinknovo/cf21268e90419e9c0e93a9bd448591a4
Features beyond current built-in (-n, -r):
Happy to help with a TypeScript PR.
Thanks. I ended up just writing a skill for myself very similar to this. Closing this PR as I feel like feature requests are not getting responses from the, understandably, busy dev team.
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.