claude-code - 💡(How to fix) Fix [FEATURE] Add ability to delete/manage past sessions [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45308Fetched 2026-04-09 08:08:22
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3
RAW_BUFFERClick to expand / collapse

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 there's no built-in way to delete or manage past Claude Code sessions. Users can only start new sessions or clear the current conversation context with /clear, but old sessions persist indefinitely in ~/.claude/projects/.

Proposed Solution

  • A /sessions list command to view past sessions (date, summary, size)
  • A /sessions delete <id> command to delete a specific session
  • A /sessions prune --older-than 30d command to bulk-delete old sessions

Alternative Solutions

  • Manually deleting files from ~/.claude/projects/ — works but is fragile, undocumented, and risks breaking state if the internal format changes

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

  • Free up disk space by removing old, irrelevant sessions
  • Remove sessions that contain sensitive information (credentials accidentally pasted, internal URLs, etc.)
  • General housekeeping — after weeks of use, sessions accumulate with no way to prune them

Additional Context

No response

extent analysis

TL;DR

Implementing a /sessions command with list, delete, and prune subcommands can help manage past Claude Code sessions.

Guidance

  • Consider adding a /sessions list command to display past sessions with details like date, summary, and size to help users identify which sessions to manage.
  • Implement a /sessions delete <id> command to allow users to delete specific sessions by their ID.
  • Develop a /sessions prune --older-than 30d command to enable bulk deletion of old sessions, helping with disk space management and removing sensitive information.
  • Ensure that any new commands or features are properly documented to avoid the fragility and risks associated with manual file deletion from ~/.claude/projects/.

Example

# Example of how the /sessions command could be structured
/sessions list
/sessions delete <session_id>
/sessions prune --older-than 30d

Notes

The implementation details of the /sessions command and its subcommands are not specified, so the exact steps for development are not provided. Additionally, ensuring the security and integrity of the session data during deletion is crucial.

Recommendation

Apply a workaround by implementing the proposed /sessions command with its subcommands, as it directly addresses the need to manage past sessions and provides a structured approach to session management.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING