/disk-cleanup:disk-cleanupfrom disk-cleanup
Free disk space on a Mac with the operator's approval, item by item, from the read-only `disk-report --json`. Use when the fleet's "Mac: under 10% free" alert fires, or the operator asks to "free up disk space", "clean up the disk", "the disk is full", "what can I delete", or "reclaim space on the Mac". Presents a SAFE / ASK / KEEP plan with each item's native cleaner copied from the report, gets SAFE approved as one batch and every ASK item one by one, runs only the approved cleaners, and shows before/after. Never on a schedule; never without approval.
Ships in disk-cleanup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A thin runner over disk-report (nix-config, packages/disk-report.py). This skill holds
no map and no rules. Every category, risk and cleaner command comes from the report's
JSON, whose one source is nix-config's packages/disk-report-rules.toml. If a cleaner looks
wrong, fix it there, never here.
cleaner, exactly as the JSON gives it. No rm, no
improvised command, no "while I'm here". An item with cleaner: null is reported with its
cleaner_null reason and left alone.halt (below) before saying anything else, then report what already ran.
Nothing more runs until a new plan is approved from scratch.trash (macOS /usr/bin/trash) moves to the Trash; the
bytes return only when the Trash is emptied, which is the operator's step in Finder. Say
so whenever a trash cleaner ran.PLAN below is node "${CLAUDE_PLUGIN_ROOT}/scripts/disk-cleanup-plan.js". Never pass
--session: the plugin's guard hook adds this session's id, which binds the plan to this
session (the guard stays silent everywhere else).
mkdir -p "${XDG_STATE_HOME:-$HOME/.local/state}/disk-cleanup", then
disk-report --json > "<that dir>/report-<UTC timestamp>.json" (add --deep only when
the operator asks: it finds node_modules, .venv and worktrees). Run it in the
background; it walks the whole disk. Do not use --redact here: the plan needs the
real paths. If the items carry no cleaner field, stop: the installed disk-report
predates cleaners; tell the operator the fleet needs activating.PLAN save --report <file>. From now on the guard asks before any
removal that reaches a KEEP item or leaves the approved paths.n:
cleaner.note (why it needs a decision).cleaner_null reasons.
Head it with the report's free space, purgeable space and the reclaim upper-bound
caveat. Show Docker's and Nix's own reclaim figures where the report has them.PLAN approve --items <n>[,<n>...].trash <path>, anything taking a path): list the
folder's FULL contents (ls -la, and du -sh per child) and check every entry against
the approved scope. Anything that is not obviously regenerable gets surfaced, not swept.
For anything that cannot be re-created — a git repo or worktree, a database, a VM —
capture it first: git -C <repo> for-each-ref --format='%(refname) %(objectname)' and
git -C <repo> bundle create <state dir>/<name>.bundle --all. Prefer the Trash over any
permanent removal; the report's cleaners already do.disk-report --json again and show BEFORE / AFTER: container free,
purgeable, and per approved item. Then PLAN end.PLAN halt drops every approval and keeps the guard asking on every removal for the rest
of the session. Then report exactly which cleaners already ran, which trash moves can be
put back from the Trash, and what cannot be undone (a prune, a runtime removal).
Each is from a real cleanup: an approved bulk removal was reversed by the operator minutes later and could not be recovered, because nobody had listed the folder against the approved scope, captured branch-to-sha or bundled the repos, or used the Trash.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kattakath/skills --plugin disk-cleanup