disk-space-cleanerlisted
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