# JSON report

`whatfrees --json` prints one JSON document. Its `schema` is `whatfrees/report@1`. The number changes only when a field changes meaning or goes away. New optional fields can appear without a new number, so ignore fields you don't know.

The types are in `whatfrees/schema`. See [the JavaScript API](https://whatfrees.loadsheet.dev/reference/api#types).

## An example

This report has two entries, cut to fit.

```json
{
  "schema": "whatfrees/report@1",
  "disk": [
    {
      "path": "/",
      "free": 190215979008,
      "total": 983040749568
    }
  ],
  "totals": {
    "safe": 21016576,
    "orphan": 30019584,
    "ask": 5005312
  },
  "skipped": [],
  "partial": false,
  "budget": {
    "ms": 5000,
    "spent": 122
  },
  "next": [
    {
      "command": "whatfrees --all",
      "reason": "2 entries hidden: in use or under the minimum"
    }
  ],
  "entries": [
    {
      "id": "worktrees:/home/you/.codex/worktrees/bb03/app",
      "source": "worktrees",
      "what": "Codex worktree of a repository that is gone",
      "path": "/home/you/.codex/worktrees/bb03/app",
      "bytes": {
        "frees": 30019584,
        "apparent": 30019584,
        "shared": 0,
        "precision": "exact"
      },
      "verdict": "orphan",
      "evidence": [
        "Its repository no longer knows it: /home/you/app/.git/worktrees/app3 is gone, so git can't tell what it holds."
      ],
      "command": "rm -rf -- /home/you/.codex/worktrees/bb03/app",
      "lastUsed": "2026-11-26T05:57:39.494Z"
    },
    {
      "id": "worktrees:/home/you/.codex/worktrees/9f2c/app",
      "source": "worktrees",
      "what": "Codex worktree of app on fix-queue",
      "path": "/home/you/.codex/worktrees/9f2c/app",
      "bytes": {
        "frees": 21016576,
        "apparent": 21016576,
        "shared": 0,
        "precision": "exact"
      },
      "verdict": "safe",
      "evidence": [
        "Clean, pushed and untouched for 9 days."
      ],
      "command": "git -C /home/you/app worktree remove /home/you/.codex/worktrees/9f2c/app",
      "lastUsed": "2026-11-26T05:57:39.494Z"
    }
  ]
}
```

## Report

| Field | Type | Meaning |
| --- | --- | --- |
| `schema` | `"whatfrees/report@1"` | The document's version |
| `disk` | `Disk[]` | One item per file system among `/`, your home folder and each `--root` |
| `totals` | `{ safe, orphan, ask }` | Bytes the `safe`, `orphan` and `ask` entries free. Counted before `--min` hides any entry |
| `skipped` | `Skipped[]` | Sources that have nothing in the report, and why |
| `partial` | boolean | `true` when a source or a walk didn't finish, so some bytes are lower bounds or missing |
| `budget` | `{ ms, spent }` | The budget in milliseconds, `null` with `--exact`, and the time spent |
| `next` | `Next[]` | Commands worth running next |
| `entries` | `Entry[]` | The things that can go, biggest `bytes.frees` first |

### Disk

| Field | Meaning |
| --- | --- |
| `path` | A path on the file system |
| `free` | Bytes an unprivileged process may still write |
| `total` | Bytes the file system holds |

### Skipped

| Field | Meaning |
| --- | --- |
| `source` | The source id |
| `reason` | `budget` when the time ran out before it answered, `error` when it failed, `remote` when its data is on another machine |
| `message` | Why it failed or was skipped. Only with `error` and `remote` |

### Next

| Field | Meaning |
| --- | --- |
| `command` | A command to run, such as `whatfrees --budget 10` |
| `reason` | Why it helps |

## Entry

| Field | Type | Meaning |
| --- | --- | --- |
| `id` | string | `<source>:<path or name>`. Stable across runs |
| `source` | string | The id of the source that found it |
| `what` | string | What it is, in a few words |
| `path` | string | The absolute path. Left out when the thing has none, as a Docker image |
| `bytes` | `Bytes` | What deleting it frees. See below |
| `verdict` | string | One of the [six verdicts](https://whatfrees.loadsheet.dev/guide/verdicts) |
| `evidence` | string[] | The facts behind the verdict, one short sentence each |
| `command` | string | A POSIX shell command, its arguments quoted. whatfrees never runs it |
| `then` | string | A command to run after `command` for the bytes to come back. Optional |
| `lastUsed` | string or `null` | An ISO 8601 time, or `null` when unknown |
| `cached` | `true` | The size came from the size cache. Optional |

The text report hides entries that are `live`, and entries that free less than `--min`. The JSON report applies the same filter. Pass `--all` for both.

## Bytes

| Field | Meaning |
| --- | --- |
| `frees` | What deleting it frees: blocks that no hard link outside it keeps |
| `apparent` | What it takes on disk, as `du` counts it. Always `frees + shared` |
| `shared` | Hard-linked bytes that stay because a link outside it keeps them |
| `precision` | How far to trust the numbers |

### Precision

| Value | Meaning |
| --- | --- |
| `exact` | The whole tree was read |
| `lower-bound` | The budget or an unreadable folder cut the walk short. The real number is at least this |
| `upper-bound` | Part of it may be shared and wasn't checked. The real number is at most this |
| `owner` | The tool that owns it reported the size, such as Docker or Ollama |
| `unmeasured` | Nothing was read in time. All three numbers are `0` |

The text report prints a lower bound as `≥4.2 GB`, an upper bound as `≤4.2 GB`, and an unmeasured entry as `unmeasured`.

## Other documents

Two more commands print JSON of their own.

| Command | `schema` | Shape |
| --- | --- | --- |
| `whatfrees check <path> --json` | `whatfrees/check@1` | See [whatfrees check](https://whatfrees.loadsheet.dev/guide/check#json) |
| `whatfrees sources --json` | `whatfrees/sources@1` | `{ schema, sources: [{ id, platforms, description }] }` |

A failure prints `{ schema, status, error }` in place of the document, with the exit code of the failure.

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

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

Next: [JavaScript API](https://whatfrees.loadsheet.dev/raw/reference/api.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.
