From claude-code-sessions
Finds old, empty, or tiny Claude Code session files that are candidates for deletion. Use when the user wants to clean up sessions, free disk space, says "clean up old sessions", or asks about session storage usage.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-sessions:session-cleanupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Find session files that are candidates for cleanup.
Find session files that are candidates for cleanup.
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts cleanup --min-messages 3
To also find old sessions:
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts cleanup --older-than 30d --min-messages 3
The script outputs a JSON object with candidates array and total_size_bytes. Present as a table:
| # | Session ID | Project | Reason | Messages | Age | Size |
|---|
Show the total reclaimable space.
NEVER delete without explicit user confirmation. Present the list and ask:
"Found N sessions (X total) that could be cleaned up. Want me to delete them? (yes/no)"
If confirmed, delete each session using the delete command:
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts delete-session <session-id>
This will also report any task lists that become orphaned.
For manual deletion, the file path is also shown:
rm "<path-to-session.jsonl>"
Report each deletion. If the user wants to keep some, ask which ones to skip.
After cleanup, check for task lists that no longer have matching sessions:
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts orphan-task-lists
If orphans are found, present them:
| Task List ID | Tasks | Last Modified |
|---|
Ask: "Found N orphan task lists with no matching session. Delete them? (yes/no/select)"
If confirmed, delete using:
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts delete-task-list <task-list-id>
Or the user can inspect and delete manually:
ls ~/.claude/tasks/<task-list-id>/
rm -r ~/.claude/tasks/<task-list-id>/
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub apappascs/claude-code-sessions --plugin claude-code-sessions