session-delete
Skill2 starsChanged 26 days agoMITView on GitHub
Delete a Claude Code session file, with optional cleanup of associated task lists and tasks. Warns about orphaned tasks before deleting. Use when the user says "delete session", "remove session", or wants to clean up a specific session.
In this repository14 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- session-cleanupSkill
- 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
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Delete a session and optionally its associated tasks.
- Distinctive: line 30
Ask: "Delete this session?
- Distinctive: line 34
If user confirms, delete with or without tasks:
- Distinctive: line 55
Never delete without explicit confirmation
- Distinctive: line 56
Always show what will be deleted first
- Distinctive: line 57
Always show the file path for manual inspection
- Distinctive: line 58
Default to NOT deleting associated tasks unless user opts in
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Session Delete
Delete a session and optionally its associated tasks.
Step 1: Preview what will be deleted
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts session-detail <session-id>Show the session summary, token usage, and associated task lists. Also show the file path so the user can inspect it manually if desired.
Step 2: Confirm before deleting
NEVER delete without explicit user confirmation. Present:
- Session ID and project
- File path (for manual inspection:
ls -la "<path>") - Number of associated task lists and tasks that will become orphans
Ask: "Delete this session? (If you have associated tasks, I can delete those too, or leave them.)"
Step 3: Execute deletion
If user confirms, delete with or without tasks:
# Delete session only (tasks become orphans)
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts delete-session <session-id>
# Delete session and associated tasks
bun run ${CLAUDE_PLUGIN_ROOT}/lib/session-store.ts delete-session <session-id> --delete-tasksAlternatively, the user can delete manually:
rm "<session-file-path>"Step 4: Report result
Show what was deleted: session file path, and if tasks were deleted, how many.
Safety
- Never delete without explicit confirmation
- Always show what will be deleted first
- Always show the file path for manual inspection
- Default to NOT deleting associated tasks unless user opts in
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.

