Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/w2ur/claude-code-setupnpx agentmods add commands/w2ur/claude-code-setup/cleanupWrote 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.
[](https://agentmods.dev/commands/w2ur/claude-code-setup/cleanup)<a href="https://agentmods.dev/commands/w2ur/claude-code-setup/cleanup"><img src="https://agentmods.dev/badge/commands/w2ur/claude-code-setup/cleanup/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/w2ur/claude-code-setup/cleanup"><img src="https://agentmods.dev/badge/commands/w2ur/claude-code-setup/cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00028 | $0.02780 |
| Opus 5.5 | $0.00011 | $0.01112 |
| Sonnet 5.5 | $0.00006 | $0.00556 |
| Haiku 4.5 | $0.00003 | $0.00278 |
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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 221 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Run housekeeping tasks across the development environment.
Scope
- If
$0isdisk-only: run only Step 0 (disk hygiene). - If
$0isplans-only: run only the plans cleanup. - If
$0isplugins-only: run only the plugin audit. - If
$0ismemory-only: run only the memory compaction. - If
$0is empty: run all steps.
Step 0 — Disk Hygiene
Run the deterministic disk-hygiene sweep. It is the source of truth for all retention numbers (AUTO tier days/keep-counts, CONFIRM tier rules) — do not restate those numbers here, they will drift out of sync with the script.
-
Show the owner every action the sweep would take:
~/.claude/scripts/disk-hygiene.sh planPresent the grouped, per-category report as-is.
-
Apply the AUTO tier without asking (it never touches anything outside the retention rules encoded in the script, and plans are archived, never deleted):
~/.claude/scripts/disk-hygiene.sh apply -
For the CONFIRM tier — stale or empty
projects/transcript dirs and plugin temp/whitespace dirs reported by theplanrun above — present the owner with the specific paths and their sizes (e.g.du -sh <path>for each) and ask for explicit confirmation. Only on an explicit yes, re-run with the corresponding flag(s):~/.claude/scripts/disk-hygiene.sh apply --yes-projects ~/.claude/scripts/disk-hygiene.sh apply --yes-plugins(both flags can be combined in one
applycall if the owner confirms both.) The# projects:comment lines name what the script kept on purpose: dirs whose folder cannot be answered for right now, and dirs holding auto-memory. Relay them to the owner; never delete them in this step. -
Any
REPORT-verb lines are owner actions, surfaced verbatim with the script's reason field — for a marketplace with no enabled plugin, therun: claude plugin marketplace remove <name> (then delete)instruction. The# job-logscomment lines naming logs no plist writes are surfaced too; the script never touches those files, and neither does this command. Do NOT runclaude plugin marketplace removeyourself — deregistering a marketplace is a decision for the owner, not something this command automates.
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.
- 2d ago Changed b34d6c628230
- 17d ago Changed · +3 lines 1611e0f25bd9
- 24d ago Changed a026b2104465
- 2mo ago Changed · +5 lines c47a1880abdb
- 3mo ago First seen · 213 lines · 28 tokens per session scan A 4632f597f0f6
cleanup is a command published in the GitHub repository w2ur/claude-code-setup (1 stars, last pushed yesterday), licensed MIT. It adds 28 tokens to every session and 2,780 once invoked, about $0.0001 per session on Opus 5.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.
cleanup compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| cleanupw2ur/claude-code-setup | Command | 1 | yesterday | MIT | A | 28 | Claude Code |
| context-statstravisjneuman/.claude | Command | 115 | 2d ago | MIT | A | 7 | Claude Code |
| pull-learningsclosedloop-ai/claude-plugins | Command | 122 | today | Apache-2.0 | A | 12 | Claude Code |
| sync0xDarkMatter/claude-mods | Command | 86 | 7d ago | MIT | A | 31 | Claude Code |
| recall-loopjoseairosa/recall | Command | 179 | 1mo ago | MIT | A | 36 | Claude Code |
| dashboardFlorianBruniaux/claude-code-plugins | Command | 47 | yesterday | MIT | A | 11 | Claude Code |
| sessionsFlorianBruniaux/claude-code-plugins | Command | 47 | yesterday | MIT | A | 10 | Claude Code |