feat(plugins): Sessions plugin for listing and deleting sessions#34168
Open
clipod wants to merge 1 commit into
Open
feat(plugins): Sessions plugin for listing and deleting sessions#34168clipod wants to merge 1 commit into
clipod wants to merge 1 commit into
Conversation
This was referenced Mar 14, 2026
Adds /sessions:list and /sessions:delete commands to manage Claude Code sessions stored locally. Project-scoped by default with cross-platform support (macOS, Linux, Windows). Features: - UUID glob pattern to exclude subagent files from listings - Orphan detection for sessions missing metadata - Deletes session JSONL, metadata, and subagent logs - Uses Read/Glob for discovery (no unnecessary permission prompts) - Safe: confirms before deleting, protects active session Closes anthropics#16901 Related: anthropics#18502, anthropics#19574, anthropics#23423, anthropics#23979, anthropics#25304, anthropics#13780, anthropics#19138, anthropics#21347
ff19ec7 to
c75a309
Compare
This was referenced Mar 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
sessionsplugin with/sessions:listand/sessions:deletecommands — the most requestedsession management feature in this repo.
--allforall projects
~/.claude), Linux ($XDG_CONFIG_HOME/claude), Windows(
%APPDATA%\claude), and$CLAUDE_CONFIG_DIRoverridedeletion
recursive deletion
Closes #16901
Related: #18502, #19574, #23423, #23979, #25304, #13780, #19138, #21347
Files Changed
plugins/session-manager/
├── .claude-plugin/plugin.json # Plugin metadata
├── commands/
│ ├── list.md # /sessions:list [--all | search term]
│ └── delete.md # /sessions:delete [session-id | search | --all]
└── README.md
.claude-plugin/marketplace.json # Registered under "productivity" category
How It Works
/sessions:listUses Glob with a UUID pattern (
????????-????-????-????-????????????.jsonl) to find session files whileexcluding subagent logs in nested directories. Reads first lines to extract titles, matches against
metadata for start times. Sessions without metadata are marked
[orphan]./sessions:deleteSame discovery, then presents a numbered list. User selects by number, UUID, search term, or "all". After
confirmation, deletes:
{sessionId}/subagent logs directory (rm -r){sessionId}.jsonlconversation data (rm){pid}.jsonmetadata (rm)Cross-Platform Config Resolution
$CLAUDE_CONFIG_DIR%APPDATA%\claude→%LOCALAPPDATA%\claude→~\.claude$XDG_CONFIG_HOME/claude→~/.claude~/.claudeTest Plan
/sessions:listshows only current project's sessions (no permission prompts)/sessions:list --allshows sessions across all projects/sessions:deletepresents numbered list, asks for confirmationContext
This is one of the most requested features — #16901 has 44 upvotes with 8+ duplicate issues. While a
native CLI approach would require core changes, this plugin provides an immediate solution.