agentleFS
apappascsapappascs/claude-code-sessions/skills/session-delete/SKILL.md

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.

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
  1. Distinctive:

    Delete a session and optionally its associated tasks.

    line 11
  2. Distinctive:

    Ask: "Delete this session?

    line 30
  3. Distinctive:

    If user confirms, delete with or without tasks:

    line 34
  4. Distinctive:

    Never delete without explicit confirmation

    line 55
  5. Distinctive:

    Always show what will be deleted first

    line 56
  6. Distinctive:

    Always show the file path for manual inspection

    line 57
  7. Distinctive:

    Default to NOT deleting associated tasks unless user opts in

    line 58

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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-tasks

Alternatively, 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.