disk-cleanup
БесплатноЗапускает вложенные скриптыНе проверенAudit and reclaim disk space on macOS with cold-first replacement-cost classification and guarded safe, extra, and deep inventories. Use when disk space is…
от inline-chat★ 915 звёзд на GitHubОб этом скилле
For internal Inline work, prefer a separately installed global disk-cleanup package at ${CODEX_HOME:-$HOME/.codex}/skills/disk-cleanup/SKILL.md when it resolves outside this repository. Load that maintained guidance instead of this generic fallback; do not copy private instructions here. Current user and repository instructions still take precedence.
Disk Cleanup
Use scripts/disk-cleanup.sh for repeatable audits. Keep source, personal data, credentials, databases, Docker volumes, .env files, mounted device filesystems, and active build state out of scope.
Workflow
- Check free space,
.running, and exactxcodebuild, Cargo, Rust, and Swift compiler processes. - Run
scripts/disk-cleanup.sh coldfirst. Search for at least the requested amount before proposing hot caches. - Report exact paths, sizes, age/activity, and replacement impact in these buckets:
- no immediate replacement: superseded installers/apps, updater downloads, old diagnostics, and one-off temp/export artifacts;
- rebuild only if reopened: generated outputs inside backups, dormant labs/clones, old one-off DerivedData, and old incremental state;
- hot/expensive: current targets, package/module caches, current DerivedData, device support, and release-reuse trees;
- excluded: source, personal/user data, databases, credentials, mounted devices, and irreplaceable history.
- Inspect large Rust targets before proposing them. Separate
target/debug/incrementalfromdeps, release, and cross-build outputs; recent targets are hot even when large. - Ask for confirmation naming literal paths. A general request to free space is not deletion approval.
- Immediately before deletion, remeasure each approved path and recheck relevant processes. Delete one literal path at a time; never feed a generated list or shell variable to a recursive deletion command.
- Re-audit and report actual space recovered, failures, and skipped targets.
The helper is audit-only and deliberately refuses --execute. It omits any candidate containing .env or .env.* instead of measuring it. Never read, print, edit, or delete .env files. Do not broaden targets with git clean, wildcards, cache resets, or generated deletion loops. Do not delete while a relevant build is active.
Use filesystem-bounded size checks (du -x) and inspect mounts before counting or deleting. Never treat ~/Library/Developer/CoreDevice/DeviceFS as Mac cache space: it is commonly a mounted projection of a physical device, and deleting there can affect device-visible data.
Preserve complete current-project package caches, current Xcode DerivedData, iOS DeviceSupport, simulator runtimes in use, downloaded toolchains pinned by a checkout, and reusable release DerivedData. Large size alone is not evidence that a cache is cold.
Modes
Modes become increasingly disruptive; cold is the default and is separate from the cumulative legacy tiers:
cold: old temporary/updater data, old one-off DerivedData entries, inactive Xcode apps, and generated.build,target,_build, orDerivedData*trees that are at least 100 MiB, have no recently modified files, and sit outside hot project state. It excludes shared/current DerivedData,node_modules, package-manager caches, current build/release trees, and mounted device filesystems. Default age is 7 days.safe: old temporary files; Trash; Sparkle updater caches; old Xcode DerivedData entries; stale project build outputs in non-current projects; oldnode_modulesand Rusttargetdirectories. Items may be recreated or redownloaded, but current-project and recently modified developer outputs are excluded. Default age is 30 days.extra: everything insafe, plus hot package/module caches, all Xcode DerivedData, current-project build outputs (build,.build,DerivedData, andtarget), and common Bun/npm/Cargo/Go/SwiftPM/Playwright caches.deep: everything inextra, plus dependency trees across developer projects and inventories of unavailable Apple simulators and Docker state. It still excludes Docker volumes, databases, source, documents, downloads, archives, keychains, app support, and available simulator devices.
Use cold by default. Treat safe, extra, and deep as triage inventories, not permission to delete; subsequent builds and installs may be slow or require network access.
Script usage
.codex/skills/disk-cleanup/scripts/disk-cleanup.sh cold
.codex/skills/disk-cleanup/scripts/disk-cleanup.sh extra --project /absolute/project/path
.codex/skills/disk-cleanup/scripts/disk-cleanup.sh deep --project /absolute/project/path
.codex/skills/disk-cleanup/scripts/disk-cleanup.sh cold --protect /absolute/active/dependency-root
--json includes each target's replacement-impact class. Either legacy execution flag, --execute or --yes, returns a clear refusal for compatibility with older invocations.
Optional controls:
--project PATH: identify the active project to p
Установить disk-cleanup в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл disk-cleanup?
Audit and reclaim disk space on macOS with cold-first replacement-cost classification and guarded safe, extra, and deep inventories. Use when disk space is low, builds fail with no-space errors, or the user asks to inspect, clean, prune, or remove caches, temporary files, Docker artifacts, Xcode data, build outputs, node_modules, target directories, or other reproducible developer artifacts without immediately forcing expensive rebuilds or downloads.
Как установить скилл 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