A report is a snapshot. A person may have opened the worktree a minute after the scan. whatfrees check asks again, about one path.
whatfrees check ~/.codex/worktrees/9f2c/appwhatfrees check: ok. no problems /home/you/.codex/worktrees/9f2c/app is safe: deletable.
Clean, pushed and untouched for 9 days.whatfrees check ~/.codex/worktrees/56bb/appwhatfrees check: failed. no problems /home/you/.codex/worktrees/56bb/app is unsaved: don't delete it.
git status lists 2 changed or untracked: a.txt, big.bin.Exit codes
Section titled "Exit codes"| Code | Meaning |
|---|---|
| 0 | The path exists and its verdict is safe or orphan |
| 1 | Anything else: the path is live, unsaved, ask or unchecked, or doesn't exist |
| 2 | Usage error, such as a missing path |
For automatic worktree cleanup, require both exit code 0 and a safe verdict. An orphan can also exit with 0: that confirms the verdict, not that the files are backed up. Leave it for a person to inspect and approve.
What it re-runs
Section titled "What it re-runs"It runs the same checks as a scan, for one path: the process table, the file times, git status, the unpushed commits and the stash log. It doesn't size anything.
Some paths get a special answer:
- A path that doesn't exist is
unchecked, withexists: false. - A symlink is judged as the link itself, found through its parent folder, not the folder it points to.
- A folder that holds git checkouts, such as
~/.codex/worktrees/9f2c, isask: check each checkout instead. - A folder that isn't a checkout is a leftover. A leftover is
ask, socheckdoesn't clear it. A regular file isorphanonly when it sits in an agent's worktree folder and hasn't changed for 30 days.
whatfrees check knows Git checkouts and the agents' leftovers. It cannot verify a pnpm store; see the report's evidence instead.
--json prints a whatfrees/check@1 document.
{
"schema": "whatfrees/check@1",
"path": "/home/you/.codex/worktrees/9f2c/app",
"exists": true,
"verdict": "safe",
"deletable": true,
"evidence": ["Clean, pushed and untouched for 9 days."]
}| Field | Type | Meaning |
|---|---|---|
schema | "whatfrees/check@1" | The document's version |
path | string | The absolute path that was checked |
exists | boolean | Whether anything is at the path |
verdict | string | One of the six verdicts |
deletable | boolean | true only for safe and orphan, and only when the path exists |
evidence | string | The facts behind the verdict |