session-cleanup
Skill2 starsChanged 26 days agoMITView on GitHub
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.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- desertcache/agent-ostheir own version, first seen Nov 1, 2026
- edloidas/skillstheir own version, first seen Nov 1, 2026
- FuDesign2008/open-skillstheir own version, first seen Nov 1, 2026
- ArcanEdge-AI/coding-agent-playbook-codextheir own version, first seen Aug 17, 2026
- Tourbillon-cpu/claude-skillstheir own version, first seen Jul 16, 2026
- ArcanEdge-AI/coding-agent-playbook-claude-codetheir own version, first seen Jul 8, 2026
Used with
Projects with it also use handoff.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- FuDesign2008/open-skills★ 6same name
- ArcanEdge-AI/coding-agent-playbook-codex★ 3same name
- edloidas/skills★ 2same name
- ArcanEdge-AI/coding-agent-playbook-claude-code★ 0same name
- ChristopherA/claude_code_tools★ 0same name
- desertcache/agent-os★ 0same name
- Tourbillon-cpu/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- session-deleteSkill
- session-detailSkill
- session-diffSkill
- session-exportSkill
- session-listSkill
- session-memory-auditSkill
- session-memory-searchSkill
- session-memorySkill
- session-resumeSkill
- session-searchSkill
- session-statsSkill
- session-tasksSkill
- session-timelineSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
If confirmed, delete each session using the delete command:
- Distinctive: line 55
After cleanup, check for task lists that no longer have matching sessions:
- Distinctive: line 61
If orphans are found, present them:
- Very specific: line 66
Ask: "Found N orphan task lists with no matching session.
- Distinctive: line 68
If confirmed, delete using:
- Distinctive: line 82
Always show the full list before asking for confirmation
- Distinctive: line 83
Delete one file at a time, reporting each
- Distinctive: line 84
If in doubt, suggest the user review the list first
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Session Cleanup
Find session files that are candidates for cleanup.
Step 1: Identify candidates
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts cleanup --min-messages 3To also find old sessions:
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts cleanup --older-than 30d --min-messages 3Step 2: Present candidates
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.
Step 3: Confirm before deleting
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.
Step 4: Check for orphan task lists
After cleanup, check for task lists that no longer have matching sessions:
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts orphan-task-listsIf 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>/Safety
- The script only identifies candidates — it never deletes
- Always show the full list before asking for confirmation
- Delete one file at a time, reporting each
- If in doubt, suggest the user review the list first
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

