Skip to content

[FEATURE] Add session deletion and file cleanup functionality #42077

@dukang1996

Description

@dukang1996

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

Currently, Claude Code has no way to delete conversations:

  1. VS Code extension: Deleting a conversation in the plugin UI does not remove the corresponding .jsonl files in ~/.claude/projects/<hash>/. The files keep accumulating and waste disk space.

  2. Terminal version: There is no command like claude conversation delete <id> to delete conversations at all.

  3. No user-friendly session management: Session files are stored as UUIDs (e.g., 3aec4d13-4203-4764-88e0-22857f54de7a.jsonl), making it impossible for users to identify which file corresponds to which conversation without manually parsing the JSON content.

Proposed Solution

Short term:

  • When a user deletes a conversation in the plugin or terminal, automatically clean up the associated .jsonl files and related directories at the same time.
  • Add a claude conversations list command to show all sessions with human-readable info (e.g., first message preview, timestamp, size).
  • Add a claude conversation delete <id> command for terminal users.

Long term (nice to have):

  • Provide a session management UI in the VS Code extension showing conversation history with previews.
  • Add ability to rename sessions to something meaningful.

Why this matters

  • Disk space: Over months of regular use, the ~/.claude/projects/ directory can grow to several GB with old session files that serve no purpose once a conversation is deleted.
  • User trust: Users expect that "deleting" something actually removes it, not just hides it from the UI.
  • Usability: UUIDs are not human-readable, making manual cleanup impossible for users who want to reclaim disk space.

Environment

  • Claude Code version: 2.1.78
  • OS: Windows 11 (also applies to macOS/Linux)
  • Installation type: VS Code extension + npm global installation

Thank you for considering this feature!

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

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions