← ClaudeAtlas

disk-space-cleanerlisted

Reclaim disk space by finding and deleting regenerable build/dependency directories (node_modules, target, .next, dist, build, .gradle, .turbo) and optionally running `cargo clean` and Docker prune. Dry-run by default, age-gated, and protects git-locked worktrees plus recently-touched work so active sessions are never clobbered. Use when disk is low, when `df` shows the volume near full, or when the user says "clean disk", "free up space", "disk-space-cleaner", or "what's eating my disk".
stevengonsalvez/agents-in-a-box · ★ 18 · AI & Automation · score 75
Install: claude install-skill stevengonsalvez/agents-in-a-box
# disk-space-cleaner Free disk by deleting only **regenerable** build/dependency dirs. Never touches source. Dry-run first, always. ## Golden rules 1. **Diagnose before deleting.** Show the user where space went. 2. **Dry-run, then apply.** The script deletes nothing without `--apply`. 3. **Only regenerable dirs.** `node_modules` (reinstall), `target` / `.next` / `dist` / `build` / `.gradle` / `.turbo` (rebuild). Source is never a target. 4. **Protect active work.** Skip anything modified in the last N days (default 14) and anything under a git worktree marked `locked`. 5. **Confirm the big irreversible ones** (Docker volumes, `sudo rm` of OS installer leftovers) with the user before running. ## Step 1 — diagnose Find the biggest consumers. Hidden dirs (dotfiles, `~/Library` on macOS) are the usual culprits. ```bash df -h . # how full, how much free du -xh -d 1 "$HOME" 2>/dev/null | sort -rh | head -20 du -xh -d 2 <big-dir> 2>/dev/null | sort -rh | head -25 # drill down ``` Common hogs: Rust `target/` (tens of GB of debug artifacts), per-worktree `node_modules`/`target`, Docker.raw, ML model caches (`~/.cache/huggingface`, `~/.cache/uv`), emulator images (`~/.android/avd`), iOS simulators. ## Step 2 — sweep (this skill's script) ```bash # dry-run: list what WOULD be deleted, nothing removed scripts/clean.sh ~/some/dir ~/another/dir # apply after reviewing the list scripts/clean.sh ~/some/dir --apply # tune age ga