cleanup

cleanup is a command for Claude Code from xiaolai/mac-it-guy-pro. It costs 21 tokens per session (530 once invoked), scanned A, original, MIT.

A guided Mac cleanup command that finds possible space savings and moves only approved items to the Trash. The Trash keeps deleted items recoverable until the user empties it.

In plain words
What is it for?
Finding caches, old downloads, large stale files, duplicates, developer leftovers, and Trash contents, then cleaning selected items.
Why use it?
It shows the items, sizes, and risks first, so files are not removed in bulk without approval.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the mac-it-guy-pro plugin — 8 skills, 12 commands, 4 agents, 2 hooks shipped together

Good fit Finding caches, old downloads, large stale files, duplicates, developer leftovers, and Trash contents, then cleaning selected items.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add xiaolai/mac-it-guy-pro
Claude Code
/plugin install mac-it-guy-pro

Made for: Claude Code.

Or install mac-it-guy-pro, the plugin that ships this one along with the rest of its 8 skills, 12 commands, 4 agents, 2 hooks.

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/commands/xiaolai/mac-it-guy-pro/cleanup/github.svg)](https://agentmods.dev/commands/xiaolai/mac-it-guy-pro/cleanup)
Your own site
<a href="https://agentmods.dev/commands/xiaolai/mac-it-guy-pro/cleanup"><img src="https://agentmods.dev/badge/commands/xiaolai/mac-it-guy-pro/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.

agentmods 80×15 button for cleanup

Your own site · 80×15
<a href="https://agentmods.dev/commands/xiaolai/mac-it-guy-pro/cleanup"><img src="https://agentmods.dev/badge/commands/xiaolai/mac-it-guy-pro/cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 530 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.00021 $0.00530
Opus 5.5 $0.00008 $0.00212
Sonnet 5.5 $0.00004 $0.00106
Haiku 4.5 $0.00002 $0.00053

Measured 1mo ago against content hash f36c6ead0bd9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

commands/cleanup.md · 37 lines

How it starts

The opening of the file, as written. The whole thing — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cleanup — reclaim space without breaking anything

Read ${CLAUDE_PLUGIN_ROOT}/skills/it-core/SKILL.md first — the safety contract is binding, especially: Trash never rm, only the user empties the Trash, dry-run first. Read ~/ITGuy/machine.md if it exists. If uname is not Darwin, say this version supports Mac only and stop.

Step 1: Scan (changes nothing)

Record free space now (df -h /). Dispatch the mac-it-guy-pro:janitor agent (via Task) in scan mode across all its categories: app caches, old downloads, large stale files, duplicates, developer leftovers, Trash size.

Step 2: Present findings and let the user choose

Show the janitor's candidate table (Category | Items | Size | Risk) in plain language. Then use AskUserQuestion (multiSelect) to pick categories to clean. Rules:

  • Large stale files and duplicates are never offered as a bulk category — if selected, walk through them item by item (or group by group) with an explicit keep/Trash choice per item.
  • If total reclaimable space is under 1 GB, say cleanup isn't worth it right now and show what's actually using the disk instead (top du folders).

Step 3: Execute the approved list only

Dispatch the janitor in execute mode with the exact approved categories/paths. Nothing outside the approved list moves — no matter how obviously junk it looks.

Step 4: Report and log

  • Before/after free space from df -h /, and the total now sitting in the Trash.
  • Close with: emptying the Trash in Finder is what makes the space real, and that step is the user's.
  • Append the visit line to ~/ITGuy/visits.log. If disk pressure was on the profile's Watch List, update it with today's numbers.

Errors

  • Locked or permission-blocked files → report each with a plain-language cause; never force.
  • The guard hook blocks an rm → that is the contract working; the janitor must use the Trash recipe. If it happens, note it and continue via Trash.
  • User approves nothing → fine; report the scan findings as a reference and log the visit as scan-only.

Read the full file on GitHub · 37 lines

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. 1mo ago First seen · 37 lines · 21 tokens per session scan A f36c6ead0bd9

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository xiaolai/mac-it-guy-pro (6 stars, last pushed 16d ago), licensed MIT. It adds 21 tokens to every session and 530 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.