Skip to content

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

@qsimeon

Description

@qsimeon

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • 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.

  2. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions