# Command line

```text
whatfrees [options]       report what can go, biggest first
whatfrees sources         list the sources
whatfrees check <path>    re-check one path right before deleting it
```

## Options

| Flag | Default | Meaning |
| --- | --- | --- |
| `--only <ids>` | all sources | Run only these sources, comma-separated. Repeatable. An unknown id is a usage error |
| `--root <dir>` | none | Also look in this folder. Repeatable. See [Sources](https://whatfrees.loadsheet.dev/guide/sources#agent-worktrees) |
| `--budget <s>` | `5` | Seconds for the whole scan. `0` asks owners and walks nothing |
| `--min <size>` | `50MB` | Hide entries that free less. Takes `200MB`, `1.5G`, `200 MiB` or plain bytes, in powers of 1024 |
| `--exact` | off | Walk every tree to the end, whatever the budget. Skips the size cache |
| `--all` | off | Also show entries that are in use or under `--min` |
| `--no-cache` | off | Don't read or write the size cache |
| `--json` | off | Print the `whatfrees/report@1` document |
| `--help`, `-h` | | Print the usage |
| `--version` | | Print the version. It answers before anything else loads |


[readerly](https://readerly.loadsheet.dev) shapes the output and reads its own flags too, such as `--format`, `--full`, `--max-chars` and `--color`.

## Output

The first line says how the run went and how long it took. The second gives the totals and the free space.

```text
whatfrees: ok. no problems in 3 entries (0.1 s).
Frees 20 MB safe, 29 MB orphan, 4.8 MB ask. / has 180 GB free of 916 GB.
```

Then one line per entry: the size, the verdict, what it is, why, and the command. A `Partial:` line appears when sizes are lower bounds or missing, and a `skipped:` line for each source with no answer. Last come the `next:` lines.

## Exit codes

| Code | Meaning |
| --- | --- |
| 0 | The run finished. For `check`, the path is `safe` or `orphan` |
| 1 | The run failed. For `check`, the path is anything else, or doesn't exist |
| 2 | Usage error: an unknown flag, a bad `--min` or `--budget`, an unknown source id, or a wrong number of arguments |

A finished scan exits with 0 even when it found nothing, or when it is partial. Read `partial` and `skipped` for that.

For `check`, exit code 0 alone does not clear a path for automatic deletion. An `orphan` still needs manual review. See [whatfrees check](https://whatfrees.loadsheet.dev/guide/check).

## Environment

| Variable | Effect |
| --- | --- |
| `XDG_CACHE_HOME` | Where the size cache goes. See [Installation](https://whatfrees.loadsheet.dev/guide/installation#where-the-size-cache-goes) |
| `CODEX_HOME` | Where whatfrees looks for Codex's `worktrees` folder |
| `CLAUDE_CONFIG_DIR` | Where whatfrees reads `.claude.json` to find Claude Code's projects |

whatfrees runs on Linux and macOS. On any other platform it stops with an error.

<!-- vitehub-docs:section-links -->
## In this section

- [Command line](https://whatfrees.loadsheet.dev/raw/reference/cli.md) (this page)
- [JSON report](https://whatfrees.loadsheet.dev/raw/reference/report.md)
- [JavaScript API](https://whatfrees.loadsheet.dev/raw/reference/api.md)

Next: [JSON report](https://whatfrees.loadsheet.dev/raw/reference/report.md)

All pages: [llms.txt](https://whatfrees.loadsheet.dev/llms.txt)

Something on this page does not work as written? Tell the user, and draft an issue for them to post: [issue tracker](https://github.com/words-with-agents/whatfrees/issues). Report a security vulnerability privately, never in a public issue.
