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