Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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

  1. Check free space, .running, and exact xcodebuild, Cargo, Rust, and Swift compiler processes.
  2. Run scripts/disk-cleanup.sh cold first. Search for at least the requested amount before proposing hot caches.
  3. 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.
  4. Inspect large Rust targets before proposing them. Separate target/debug/incremental from deps, release, and cross-build outputs; recent targets are hot even when large.
  5. Ask for confirmation naming literal paths. A general request to free space is not deletion approval.
  6. 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.
  7. 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, or DerivedData* 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; old node_modules and Rust target directories. Items may be recreated or redownloaded, but current-project and recently modified developer outputs are excluded. Default age is 30 days.
  • extra: everything in safe, plus hot package/module caches, all Xcode DerivedData, current-project build outputs (build, .build, DerivedData, and target), and common Bun/npm/Cargo/Go/SwiftPM/Playwright caches.
  • deep: everything in extra, 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
Полный SKILL.md на GitHub

Установить disk-cleanup в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

agents/openai.yamlscripts/disk-cleanup.sh

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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить disk-cleanup с