delete-session

delete-session is a command for Claude Code from enricoros/big-AGI. It costs 16 tokens per session (210 once invoked), scanned B, original, MIT.

A command that removes one Claude Code session, identified by a UUID, along with its transcript, subagent transcripts, session state, and file history.

In plain words
What is it for?
Deleting a specific Claude Code session and confirming which matching files and directories were found and removed.
Why use it?
It clears a session and its stored artifacts when they are no longer needed, while refusing malformed identifiers to avoid guessing the target.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/enricoros/big-agi/delete-session
Clone the repo
git clone --depth 1 https://github.com/enricoros/big-AGI

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for delete-session

README.md
[![agentmods](https://agentmods.dev/badge/commands/enricoros/big-agi/delete-session.svg)](https://agentmods.dev/commands/enricoros/big-agi/delete-session)
Your own site
<a href="https://agentmods.dev/commands/enricoros/big-agi/delete-session"><img src="https://agentmods.dev/badge/commands/enricoros/big-agi/delete-session.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 210 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.00210
Opus 5 $0.00008 $0.00105
Sonnet 5 $0.00003 $0.00042
Haiku 4.5 $0.00002 $0.00021

Measured 4d ago against content hash c0aa6fa77e29, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

delete-session scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

find ~/.claude/projects -maxdepth 2 -name "$ARGUMENTS.jsonl" -print -delete
.claude/commands/delete-session.md · 21 lines

What it actually says

Delete the Claude Code session with ID $ARGUMENTS - the transcript wherever it lives under any project dir, its subagent transcripts, and its per-session state.

First check the argument: if $ARGUMENTS is not exactly one UUID (8-4-4-4-12 hex), stop and say so - do not guess or delete anything.

Then run these deletions (each target may or may not exist):

find ~/.claude/projects -maxdepth 2 -name "$ARGUMENTS.jsonl" -print -delete
rm -rfv ~/.claude/projects/*/"$ARGUMENTS"
rm -rfv ~/.claude/session-env/"$ARGUMENTS" ~/.claude/file-history/"$ARGUMENTS"

After running, confirm what was found and removed.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 21 lines · 16 tokens per session scan B c0aa6fa77e29

Subscribe to this mod's changes

delete-session is a command published in the GitHub repository enricoros/big-AGI (7,109 stars, last pushed today), licensed MIT. It adds 16 tokens to every session and 210 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.