← ClaudeAtlas

disk-space-cleanerlisted

Reclaim disk by deleting regenerable build and dependency directories (target, node_modules, .next, build, .turbo, .venv), biggest first, skipping any whose owning directory shows a live process, a live tmux session, or a git worktree lock. Dry-run by default, and the dry-run runs every check the apply does. Only the build directory is ever removed, never the worktree or repo containing it. 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 · ★ 23 · Web & Frontend · score 75
Install: claude install-skill stevengonsalvez/agents-in-a-box
# disk-space-cleaner Free disk by deleting only **regenerable** build and dependency directories. Never touches source, never removes a worktree. ## The three rules **1. Only the build directory, never its parent.** Clearing a worktree's `target/` must leave the worktree itself, with all its source and any uncommitted work, exactly where it was. The script asserts this **before** the `rm`: the candidate must still be a directory, must live under its scan root, and its basename must be one of the target names. A check that runs after the deletion cannot prevent anything. **2. Decide by liveness, not by age.** A `target/` rebuilt an hour ago by a session that has since finished is safe to clear. One untouched for a month can belong to a session running right now. mtime cannot tell those apart, so it is not used as a safety signal at all. An age gate looks prudent and is actively misleading: on a busy machine every large build directory is recently touched, so an age-gated sweep skips exactly the directories worth reclaiming while offering no protection to the ones in use. **3. Fail closed.** A signal that could not be collected is not the same as a signal that came back empty. If `ps`, `tmux`, `lsof` or `git` is missing or unreadable, `--apply` refuses and reports `held (liveness incomplete)` rather than deleting blind. This is re-evaluated after every re-read, not decided once at startup: a `ps` that succeeds before the sizing pass and fails during it must stop the run,