[FEATURE] Add `/list-sessions` and `/delete-session` slash commands for better session management

Status Fixed / completed
Maintainer reply None cached
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:

  1. No way to list sessions without resuming - claude --resume forces an interactive selection interface. Users who just want to see their session history must navigate through the interactive menu.
  1. No way to delete sessions - There's no CLI command or slash command to delete a specific session by ID. While claude --resume clearly 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_

View original on GitHub ↗

9 Comments

github-actions[bot] · 7 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/13780
  2. https://github.com/anthropics/claude-code/issues/15576

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

qsimeon · 7 months ago
Found 2 possible duplicate issues: 1. [[FEATURE] Add command to delete chat sessions #13780](https://github.com/anthropics/claude-code/issues/13780) 2. Add session management: delete and rename sessions in CLI and VS Code extension #15576 This issue will be automatically closed as a duplicate in 3 days. If your issue is a duplicate, please close it and 👍 the existing issue instead To prevent auto-closure, add a comment or 👎 this comment 🤖 Generated with Claude Code

The linked duplicate issues are both closed. Therefore, I cannot 👍 / 👎 to them.

github-actions[bot] · 6 months ago

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.

Mart-Bogdan · 6 months ago

How is it possible that this is not a thing yet?

noahlz · 6 months ago

I just added integration tests for my custom hooks, using claude -p to execute the tests and confirm hook behavior.

And it works! But now when I run claude --resume the 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.

diego898 · 5 months ago

@noahlz 100% this bit me until I learned about the --no-session-persistence flag to be used along with -p

zinknovo · 5 months ago

Built 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):

  • Non-interactive session listing with time/msg count/name/summary
  • Cross-project listing
  • Delete by name or index
  • Rename after creation
  • Auto-summary (LLM-generated one-liner for previous session)
  • Resume by fuzzy name match

Happy to help with a TypeScript PR.

qsimeon · 5 months ago
Built 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): Non-interactive session listing with time/msg count/name/summary Cross-project listing Delete by name or index Rename after creation Auto-summary (LLM-generated one-liner for previous session) Resume by fuzzy name match 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.

github-actions[bot] · 5 months 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.