cleanup

cleanup is a skill for Claude Code from AxGord/claude-workflow. It costs 8 tokens per session (456 once invoked), scanned A, original, MIT.

A guided cleanup procedure for data stored by Claude Code in the .claude directory. It covers temporary files, project session logs, empty project folders, and saved memory.

In plain words
What is it for?
Use it to review and remove temporary Claude data, clean project logs, find empty project folders, and audit saved memory entries.
Why use it?
Old logs, plans, snapshots, and task files can take up space and clutter future sessions, while deleting session logs can prevent resuming them.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Part of the workflow plugin — 28 skills, 2 hooks, 1 MCP server shipped together

Good fit Use it to review and remove temporary Claude data, clean project logs…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/axgord/claude-workflow/cleanup
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.

Any agent
npx skills add AxGord/claude-workflow --skill cleanup
Clone the repo
git clone --depth 1 https://github.com/AxGord/claude-workflow

Made for: Claude Code.

Or install workflow, the plugin that ships this one along with the rest of its 28 skills, 2 hooks, 1 MCP server.

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 cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/axgord/claude-workflow/cleanup.svg)](https://agentmods.dev/skills/axgord/claude-workflow/cleanup)
Your own site
<a href="https://agentmods.dev/skills/axgord/claude-workflow/cleanup"><img src="https://agentmods.dev/badge/skills/axgord/claude-workflow/cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 456 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00008 $0.00456
Opus 5 $0.00004 $0.00228
Sonnet 5 $0.00002 $0.00091
Haiku 4.5 $0.00001 $0.00046

Measured 6d ago against content hash 60a14e5d2922, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

cleanup scanned grade A with 0 findings 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 6d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/skills/cleanup/SKILL.md · 58 lines

What it actually says

.claude directory cleanup

Run steps in order. Ask user confirmation before each step.

Step 1: Temp data (always safe)

Delete contents of (keep directories themselves):

  • ~/.claude/debug/ — session debug logs
  • ~/.claude/shell-snapshots/ — zsh state snapshots
  • ~/.claude/todos/ — task lists from past sessions
  • ~/.claude/plans/ — plan files from past sessions

Show size before/after.

Step 2: Project session logs

For each project in ~/.claude/projects/:

  • DELETE: *.jsonl files (conversation logs), UUID/ directories (session caches), agent-*.jsonl (subagent logs)
  • KEEP: memory/ directory, CLAUDE.md file

⚠️ This breaks /resume for old sessions. Warn user.

Show size before/after.

Step 3: Empty project directories

After step 2, list projects that have no remaining files (no memory/, no CLAUDE.md). Offer to remove them — they recreate automatically when Claude Code runs in that project.

Step 4: Memory audit

For each remaining memory/MEMORY.md:

  1. Read its contents
  2. Check each entry against existing skills — is it already covered?
  3. Check if Claude already knows this without any skill
  4. Present table to user:
Entry Duplicates? Verdict
... skill X / common knowledge / project-specific delete / keep

Only modify after user approval.

Other cleanable files

Also check and report sizes of:

  • ~/.claude/history.jsonl — conversation history (can be large)
  • ~/.claude/file-history/ — file change history
  • ~/.claude/paste-cache/ — clipboard cache
  • ~/.claude/tasks/ — task data

These are less critical. Mention sizes, let user decide.

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. 6d ago First seen · 58 lines · 8 tokens per session scan A 60a14e5d2922

Subscribe to this mod's changes

cleanup is a skill published in the GitHub repository AxGord/claude-workflow (5 stars, last pushed 1mo ago), licensed MIT. It adds 8 tokens to every session and 456 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.