disk-cleanup
БесплатноЗапускает вложенные скриптыНе проверенScan and clean macOS caches, package-manager data, crash dumps, and app caches to reclaim disk space. Deterministic — a config registry (targets.json) plus…
от glebis★ 417 звёзд на GitHubОб этом скилле
Disk Cleanup
Deterministic by design. All target knowledge lives in targets.json; all measuring and
deleting lives in scripts/survey.py (read-only) and scripts/clean.py (executor, dry-run by
default). They run headless with zero dependencies (stdlib only) — a user can run them in a
terminal without any agent. The agent's job is small: run the scripts, relay the compressed
output, and decide the handful of things that need human judgment.
The two scripts
python3 scripts/survey.py # read-only: sizes, risk, flags, uncategorized. Touches nothing.
python3 scripts/survey.py --json # same, machine-readable (preferred for the agent)
python3 scripts/clean.py --preset safe # DRY-RUN plan (default — nothing deleted)
python3 scripts/clean.py --preset safe --go # execute (safe risk only)
python3 scripts/clean.py --preset full --allow-medium --go --empty-trash # safe+medium, then empty Trash
python3 scripts/clean.py --ids cargo-registry-cache,go-mod-cache --go # specific targets
python3 scripts/clean.py --preset safe --skip ollama-models --go # exclude one
trash is used for all file removal (never rm); freed space sits in Trash until emptied
(--empty-trash, or the user empties it). Sizes are du estimates — approximate on APFS.
Safety model (enforced in code, not prose)
- Risk gating:
saferuns automatically;mediumneeds--allow-medium;neveris refused even if named by id.advisorytargets only print guidance, never execute. - Preflight on every trashed path: canonical
realpath→ must resolve under anallowed_rootsentry → must not be a symlink → never$HOMEor/. Anything failing is skipped and reported, not deleted. - Dry-run by default:
clean.pyprints the plan and touches nothing unless--go.
Agent workflow
- Run
python3 scripts/survey.py --json. Relay the compressed summary: disk free,safe/mediumrecoverable totals, anyflags(e.g. crash-loop), and the top targets. Do not dump the whole JSON. - Auto-path: for a plain "clean up safe stuff", show the
safetotal and runclean.py --preset safe --go(offer--empty-trash). Safe targets are regenerable. Disk-full emergency (ENOSPC is blocking other work): don't start with the fullsafepreset. It quits running apps (electron-app-caches: Notion, Figma, Obsidian, Codex, Dropbox), and itstrash-method targets free nothing until the Trash is emptied, which also deletes the user's other trashed items. Run the command-method caches first, because they free space immediately:clean.py --ids uv-cache,npm-cache --go. Command-method caches often free far more than theirduestimate. - Escalate to the user ONLY for (these are genuine judgment calls the scripts deliberately
refuse to auto-decide):
mediumtargets (ML models, device support, projectnode_modules) — confirm before--allow-medium. ML-model targets (ollama-models,huggingface-models) carry alast_used_daysfield (newest file atime under the target, aggregate across all models in that store — not per-model) as a "how stale is this" signal; surface it before suggesting deletion.uncategorizeddiscoveries — unknown dirs >100 MB; ask or investigate before adding.advisorynotes — surface them (Telegram cache, simulators viasimctl,uv/tools, Chrome whole-dir, Xcode Archives,mo cleandeep-clean); never act on them automatically. Formole-deep-clean: suggest the user runmo cleanthemselves (interactive TUI, permanent deletes, sudo for system caches) — never invoke it from the agent. Never shell out tomoat all (not even--dry-run): it's TUI-only and blocks waiting for a real terminal even in dry-run mode — confirmed hanging under a piped subprocess,stdin=DEVNULL, and even ascript(1)-allocated pty. Amoleflag in survey.py's output only reads the mtime of mole's own leftover~/.config/mole/clean-list.txt(last-run recency), never invokes it.- surgical Docker / simulator decisions (see below).
- Run
clean.pywith the resolved selection. Relay the result (freed_human, disk before→after).
Maintaining the registry
Add or correct targets by editing targets.json — no code change needed. Each target:
{id, category, risk, method, paths|find, regenerates, priority, note}. Methods:
trash— trash literal paths (globs allowed).find-trash— exact-name dir sweep with amin_mbfloor (crash dumps, projectnode_modules).command— run a CLI (npm cache clean…); setscope_pathso freed bytes can be measured.simctl—xcrun simctl delete unavailable(removes only sims for uninstalled runtimes; safe).downloads-scan— config-driven (config.json→downloads_scan): files older thanage_dayswhose name doesn't matchexclude_patterns. The dry-run **lists every fi
Установить disk-cleanup в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл disk-cleanup?
Scan and clean macOS caches, package-manager data, crash dumps, and app caches to reclaim disk space. Deterministic — a config registry (targets.json) plus two scripts (survey.py read-only, clean.py executor) do all the measuring and deleting; the agent only relays a compressed summary and makes the few human-judgment calls. IMPORTANT — use this skill whenever the user's request on macOS involves: freeing disk space, cleaning/clearing caches, "disk is full", "clean up my Mac", "free up space", "what's eating my disk", "running low on disk", needing space for an install, or any low-storage complaint. Covers the whole workflow survey → choose → clean → empty Trash.
Как установить скилл disk-cleanup?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл disk-cleanup запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic