/ork:disk-cleanup [--apply] [--only ID] [--tier safe|regenerable] [--root DIR] [--json]from ork
Frees disk space by cleaning caches, merged worktrees, Docker build cache, and old logs. Dry run lists items with sizes; --apply removes safe and regenerable items after user confirmation.
Ships in ork. 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.
Read when SKILL.md points to them; scripts run unread.
Running many agents and worktrees fills a disk fast: a fresh node_modules per
worktree, a build cache per tool, Docker layers, browser downloads, session logs.
This skill finds all of it, sorts it by how safe it is to remove, and removes only
what is provably safe, after you confirm.
--apply, show the inventory, and
get an explicit yes from the user in the conversation before any --apply.--apply touches two tiers only. SAFE (caches that refill on their own) and
REGENERABLE (merged, clean, idle worktrees; rebuildable stores). ASK FIRST items are
listed with the command to run. The script never runs them and neither do you without
the user naming the item.git, gh, lsof or docker call keeps the item and says why.
Never remove on a guess.node_modules, .venv, dist, build, .next, __pycache__ and
the like; an ignored .env.local keeps the tree), it is not locked, no process has
its working directory inside, nothing in it changed for 60 minutes, and it sits under
the home directory. Removal is git worktree remove without force. The branch stays.Dry run. From a repo you work in (the script scans its worktrees) or with --root DIR
for a folder that holds several repos:
python3 "${CLAUDE_SKILL_DIR}/scripts/disk_cleanup.py"
python3 "${CLAUDE_SKILL_DIR}/scripts/disk_cleanup.py" --root ~/code
Exit 0 means nothing to clean, 3 means findings, 2 means it could not look.
Show the user the inventory as printed. Lead with the verdict line, then name the three biggest rows and any KEEP lines that explain why a worktree was left alone.
Ask the user to confirm. Offer the narrower forms when they hesitate:
--tier safe (caches only) or --only npm-cache (one item id, or a section such as docker).
Apply with the command the dry run printed under "To act on exactly this list". It
pins --only to the ids the user just saw, so anything that became removable after
the dry run (a worktree that merged or went idle meanwhile) is left alone:
python3 "${CLAUDE_SKILL_DIR}/scripts/disk_cleanup.py" --apply --only npm-cache --only 'worktree:/path/to/tree'
python3 "${CLAUDE_SKILL_DIR}/scripts/disk_cleanup.py" --apply --tier safe
Expected: one line per action (done or failed), then freed (measured, before and after).
For ASK FIRST rows, read the user the printed command and what it removes. Run it only when they confirm that specific row.
Optional: --json for a machine-readable inventory, --report FILE to save it. The report
starts with a marker line and the script refuses to overwrite a file without it.
| Tier | Meaning | Examples |
|---|---|---|
| 🟢 SAFE | Pure cache, the tool refills it | npm, pip, uv, Cargo, Go caches, Homebrew downloads, Xcode DerivedData, browser caches, Docker build cache and dangling images, agent debug logs older than 14 days |
| 🟡 REGENERABLE | Rebuilds, but costs time or bandwidth | merged worktrees, pnpm store, Playwright browsers, unused Docker images |
| 🔴 ASK FIRST | Might be someone's work | unmerged or detached worktrees, session transcripts, Downloads, Trash, Docker volumes, orphan agent processes |
Full path list per OS and the evidence behind each gate: references/catalog.md.
disk-cleanup dry run: 47.1 G reclaimable, 24.0 G more needs you
DISK ~ (macOS)
[▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░]
used 355.0 G free 73.0 G 83 % full · 460.0 G total
────────────────────────────────────────────────────────────────────────
🟢 SAFE caches that refill on their own
────────────────────────────────────────────────────────────────────────
🐳 Docker build cache ▓▓▓▓▓▓▓ 14.5 G prune
🌐 Browser caches ▓▓▓▓░░░ 8.9 G clear
📦 npm cache ▓▓▓░░░░ 6.2 G clear
── 29.6 G
────────────────────────────────────────────────────────────────────────
🟡 REGENERABLE merged worktrees and rebuildable stores
────────────────────────────────────────────────────────────────────────
🗂️ app/fix-login merged PR #412 ▓▓▓▓░░░ 3.9 G remove
KEEP app/hotfix-7 dirty (3 files)
KEEP app/agent-3 process cwd inside (pid 4121)
🟢 29.6 G + 🟡 3.9 G = 33.5 G estimated → free 73.0 G → ~106.5 G
ℹ️ Sizes are allocated blocks, so sparse files read small.
User says: "my disk is almost full, I run a lot of agents".
Actions: run the dry run, show the inventory, ask to confirm, run --apply.
Result: SAFE and REGENERABLE items removed, a measured freed total, ASK FIRST rows left for the user.
User says: "clean up old worktrees only".
Actions: dry run, then --apply --only worktrees after confirmation.
Result: merged clean worktrees removed, everything else untouched.
| Symptom | Cause | Fix |
|---|---|---|
| Every worktree reads KEEP "process list unreadable" | lsof missing or blocked (some sandboxes) | Run the script outside the sandbox, or install lsof. Never skip the check. |
| Squash-merged worktrees read as unmerged | gh missing or not logged in | gh auth login, then rerun. They stay ASK FIRST until then. |
| Docker items missing | Docker daemon not running | Start Docker and rerun. The caveat line says so. |
| Freed total is smaller than the estimate | Docker Desktop keeps its disk image at full size, APFS snapshots hold blocks | Trust the measured number. Compact Docker Desktop's disk image from its settings. |
git worktree remove refused | The tree changed between the dry run and --apply | Rerun the dry run. It will classify the tree again. |
Every applied action appends one JSON line to ~/.local/state/ork/disk-cleanup-ledger.jsonl
(override with --ledger), plus one summary line per run.
macOS first, Linux second. Windows is not supported. The skill frees disk space only: it does not stop sessions, delete branches, or touch anything outside the home directory.
ork:dev: stop a branch's dev loop before its worktree is removed.ork:doctor: project and plugin health, the other maintenance check next to disk space.ork-extras:careful: guard destructive shell commands while a cleanup runs.What SKILL.md sets; muted values are Claude Code's defaults
lownpx claudepluginhub yonatangross/orchestkit --plugin ork-alpha2 plugins ship this exact skill · first indexed Nov 20, 2026
82 skills in this plugin
/analyticsLocal OrchestKit usage analytics: agent and skill frequency, hook timing, session replay, cost estimates, model delegation trends. Use when reviewing usage, performance or costs./api-designAPI wire contracts for REST and GraphQL: resource shape, versioning and deprecation, RFC 9457 errors, OpenAPI. Use when designing an endpoint contract. Not for runtime code (use python-backend)./architecture-decision-recordNygard-format ADRs: context, decision, consequences, alternatives. Use when writing an ADR or recording an architectural decision.Other plugins' skills for the same job