GitHub 0
Skip to content

Installation

Run whatfrees once with npx, install it as a command, or add it to a Node program as a library.

Requires Node.js 22.20 or later on Linux or macOS. whatfrees refuses to run on Windows.

npx whatfrees
npm install --global whatfrees
pnpm
pnpm add whatfrees
npm
npm install whatfrees
yarn
yarn add whatfrees
bun
bun add whatfrees

The 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.

  1. whatfrees

    It 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.

  2. whatfrees --all --min 0

    --all adds the entries that are in use or under --min. --min 0 shows the small ones too.

  3. whatfrees --root ~/scratch

    --root adds 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.

  4. whatfrees check --json ~/.codex/worktrees/9f2c/app

    It exits with 0 when the path is safe or orphan. 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.

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.