Requires Node.js 22.20 or later on Linux or macOS. whatfrees refuses to run on Windows.
Run it once
Section titled "Run it once"npx whatfreesInstall the command
Section titled "Install the command"npm install --global whatfreesUse it as a library
Section titled "Use it as a library"pnpm add whatfreesnpm install whatfreesyarn add whatfreesbun add whatfreesThe library has one runtime dependency, readerly, which shapes the command line's output for the reader. Its entries are whatfrees, whatfrees/measure, whatfrees/sources and whatfrees/schema. See the JavaScript API.
First run
Section titled "First run"whatfreesIt prints the totals, then one line per entry, biggest first. Each line holds the size, the verdict, what it is, why, and the command. Entries that free less than 50 MB, and entries in use, are hidden. The totals still count the small ones.
Show everything
Section titled "Show everything"whatfrees --all --min 0--alladds the entries that are in use or under--min.--min 0shows the small ones too.Look in another folder
Section titled "Look in another folder"whatfrees --root ~/scratch--rootadds a folder to the worktrees source. Everything in it is a candidate: a git checkout gets the git checks, anything else is a leftover. Repeat the flag for more folders.Re-check before you delete
Section titled "Re-check before you delete"whatfrees check --json ~/.codex/worktrees/9f2c/appIt exits with 0 when the path is
safeororphan. Check the verdict too: an orphan can still contain unique files. See whatfrees check.
whatfrees prints the command and stops there. An agent should run it automatically only for a safe entry after a recheck both succeeds and still reports safe. Leave orphans for manual review.
Where the size cache goes
Section titled "Where the size cache goes"whatfrees keeps the sizes of single files in measure.json, keyed by path and modification time. The folder is $XDG_CACHE_HOME/whatfrees when that is set. Otherwise it is ~/Library/Caches/whatfrees on macOS and ~/.cache/whatfrees elsewhere. --no-cache neither reads nor writes it.