Skip to content

Add session management: delete and rename sessions in CLI and VS Code extension #15576

@jb522185660

Description

@jb522185660

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

I often use Claude Code for long-running development tasks and debugging workflows where I create multiple independent coding sessions over time.

Currently there is no way to delete a specific historical session from the CLI or VS Code plugin — the only option is to clear the entire current session.
This results in large amounts of irrelevant session history accumulating, forcing me to manually scroll through many prompts and responses, wasting tokens and time.

Similarly, in the VS Code extension there is no ability to rename or remove specific sessions, so I can’t label them with meaningful names or clean up old, unneeded sessions.
This makes session management cumbersome, increases cognitive load, and also leads to unnecessary token usage and cost because irrelevant context is preserved.

A native way to delete a session and to rename sessions in the plugin would greatly improve usability, especially for workflows that involve switching between multiple tasks or long term projects where context management is critical.

Proposed Solution

To improve session management in Claude Code, I propose the following enhancements to both the CLI and the VS Code extension:

  1. CLI Enhancements

    • Add a dedicated subcommand for session deletion, e.g.:
      claude session delete <session-id>
      
      This should permanently remove the specified session and its associated history files.
    • Add a listing subcommand that shows session IDs, timestamps, and optionally custom names:
      claude session list
      
  2. CLI & Interactive TUI Support for Naming

    • Support a session naming slash command in the interactive REPL:
      /rename <new-name>
      
      This would assign a custom human-readable label to the current session, improving clarity in session selection and history navigation.
    • Allow resuming by name as well as ID:
      claude --resume <session-name>
      
  3. VS Code Extension Improvements

    • In the session selector or session history UI, provide UI controls for:
      • Renaming a session
      • Deleting a session
    • The extension should display custom session names (if set), and offer buttons/menus to perform these actions without resorting to the CLI.

These changes would offer a more intuitive workflow for managing multiple sessions, avoid manual file cleanup (~/.claude/projects/...), and make it easier to switch between tasks in both terminal and IDE contexts.

Alternative Solutions

No response

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions