# CLI Reference
| `whetstone` | Start Claude Code through Headroom (waits for proxy, then `headroom wrap claude`) |
| `whetstone setup [--full] [--headroom-extras EXTRAS] [--headroom-remote SSH_DEST [--remote-install]]` | Install/configure all components (auto-detects v2 and hands off to `migrate`) |
| `whetstone project uninstall` | Interactive removal of whetstone files from the current project |
| `whetstone global uninstall` | Interactive removal of global components (binaries, RTK, Headroom) |
| `whetstone claude [args...]` | Run Claude Code through Headroom |
| `whetstone code [args...]` | Alias for `claude` |
| `whetstone proxy [args...]` | Run `headroom proxy` |
| `whetstone rtk [args...]` | Run RTK |
| `whetstone doctor` | Inspect installed tool versions, `~/.claude/settings.json` hooks, and the per-project manifest |
| `whetstone dashboard` | TUI dashboard for installed tool versions vs. pinned floors |
| `whetstone settings` | Interactively edit whetstone settings, layered global/project (Headroom telemetry, Headroom memory, default API model, edit/permission mode, Anthropic API URL) |
| `whetstone migrate [--dry-run] [-y] [--rollback ID]` | Migrate a v2 install to v3 (or roll back) — see [Migration Guide](migration.md) |
| `whetstone version` | Print version |
| `whetstone stats` | Token-savings summary from RTK + Headroom stats endpoints |
| `whetstone update [--full]` | Check for newer release; `--full` force-refreshes Headroom/RTK and bundled assets |
| `whetstone release patch\|minor\|major\|set X.Y.Z` | Verify, bump version, and open a release PR |
| `whetstone release-publish ...` | **Deprecated** — use `whetstone release` |
| `whetstone memory consolidate [--dry-run]` | Drain a stray project-local `.headroom` store into the global `~/.headroom` root (fixes cross-project memory litter) |
| `whetstone changelog-sync [--input F] [--output F] [--limit N]` | Regenerate `site/src/changelog.js` from `CHANGELOG.md` (maintainer tooling) |
The global `--memory` flag (e.g. `whetstone --memory` or `whetstone --memory claude`)
enables Headroom persistent cross-session memory for that run. Persist it per-project
or globally via `whetstone settings` (Headroom Memory).
Because whetstone runs a single shared Headroom proxy, it pins the memory store
root to a global location (`~/.headroom/memory.db` via `HEADROOM_MEMORY_DB_PATH`)
so per-project memory DBs land under `~/.headroom/memories/projects/` instead of
littering whichever project happened to launch the proxy. On launch, whetstone
also auto-consolidates any stray project-local `.headroom` store into that global
root (conservative: it never overwrites existing global data and leaves a legacy
seed DB in place rather than mixing stores). Run `whetstone memory consolidate
--dry-run` to preview.
Add a `headroom_env` map to `.claude/whetstone.json` (project) or
`~/.whetstone/settings.json` (global) to override any Headroom launch knob
(savings profile, target ratio, memory behavior, etc.). These maps are
hand-edited JSON — the `whetstone settings` TUI does not yet expose them.
Precedence: external `HEADROOM_*` env vars > project > global > defaults;
`HEADROOM_PORT` is reserved.
## Model Update Prompt
On launch (`whetstone` / `whetstone claude`), whetstone checks the 12h-cached
Anthropic models list. If a model newer than the one this project runs — or a
brand-new model family — is available, it shows a full-screen modal offering to:
- **Pin** it as the project default (writes `api_model` to `.claude/whetstone.json`)
- **Use for this session** only (no persistence)
- **Dismiss** it permanently for this project (recorded in `dismissed_models`)
- **Not now** (offered again next launch)
The prompt is skipped when the terminal is non-interactive, whetstone is offline,
the directory is not a v3 project, or `--model` was passed explicitly.
## Headroom Extras
`--headroom-extras` controls which Headroom optional packages are installed:
| `all` (default) | `headroom-ai[proxy,code,mcp]` |
| `none` | `headroom-ai` (base only) |
| `proxy,code` | `headroom-ai[proxy,code]` (custom) |
## Remote Headroom
The Headroom proxy can run on another machine. Whetstone reaches it over an
SSH tunnel: the proxy stays bound to the remote's `127.0.0.1`, and a local
`ssh -L` makes it look like a local port, so nothing is exposed on the network.
```
whetstone setup # asks "This machine / A remote machine"
whetstone setup --headroom-remote me@big-box --remote-install # non-interactive
```
- **Setting:** `headroom_remote`, an ssh destination (`user@host`, an
`~/.ssh/config` alias, or `ssh://user@host:2222`), stored per project
(`.claude/whetstone.json`) or globally (`~/.whetstone/settings.json`), and
editable as **Headroom Remote** in `whetstone settings`. A project value of
`local` overrides a global remote. Ports, keys and jump hosts belong in the
destination or your ssh config; whetstone stores no credentials.
- **Login:** key or agent auth is required (ssh runs with `BatchMode=yes`).
Setup offers to run `ssh-copy-id`. A host you have never connected to is
refused rather than trusted silently.
- **Install:** setup can install Headroom on the remote (uv into the remote
user's home, no sudo). `whetstone install-tools` repairs it, `whetstone
update` upgrades it, `whetstone doctor` checks login, install, and that a
proxy with this project's config actually starts there.
- **Proxies:** per config, exactly like local. Each distinct config gets its
own remote proxy (state in the remote's `~/.whetstone/proxies/`) and its own
tunnel; a second session with the same config reuses both with no ssh
round trip.
- **Local Headroom is still required.** It is the client: `headroom wrap
claude` and the `headroom_retrieve` MCP tool run locally and talk to the
tunnel.
- **Remote unreachable:** whetstone warns and starts a local proxy for that
session.
- **Memory** (`--memory`) lives on the remote, under its `~/.headroom/`.
Existing local memory is not copied over.
Limits: `HEADROOM_*` variables exported in your shell reach a local proxy but
are not forwarded to a remote one (use `headroom_env` instead). Unlike local
proxies, remote ones are not stopped when idle; `whetstone update` leaves running ones on the old
version, and `whetstone install-tools --force` or `whetstone global uninstall`
stops them.
## Versioning & Updates
Whetstone uses a single `VERSION` file as the source of truth.
```bash
whetstone version # Current version
whetstone update # Check for newer release
whetstone update --full # Force-upgrade Headroom/RTK
```
For contributors:
```bash
just release-check # Release verification gate
just release patch # Verify, bump version, and open release PR
```
## Headroom Proxy Flags
```
headroom proxy [OPTIONS]
--host HOST Network interface (default: 127.0.0.1)
--port PORT Listen port (default: 8787)
--budget AMOUNT Daily USD spending limit
--log-file PATH JSONL request log
--no-optimize Passthrough mode (no compression)
--no-cache Disable response caching
--llmlingua Enable ML-based compression (~2GB download)
--backend bedrock|vertex_ai|azure|openrouter (default: anthropic)
--region Cloud region (for bedrock/vertex_ai)
```
## RTK Quick Reference
> **Heads up — RTK is not always a net win.** The PreToolUse hook only fires on
> **Bash** tool calls; Claude Code's native `Read`, `Grep`, `Glob`, and file-edit
> tools bypass it. Compression can also strip context the model needed — RTK's own
> tracker has logged a ~18% net cost-increase case. Run `rtk gain` for cumulative
> savings, `rtk discover` for missed opportunities, and consider RTK's audit mode
> when a particular rewrite feels suspect.
```bash
rtk gain rtk gain --graph rtk gain --history rtk gain --daily rtk discover rtk session
rtk ls . rtk read file.rs rtk grep "pattern" . rtk find "*.rs" .
rtk git status rtk git log -n 10 rtk git diff
rtk test cargo test rtk pytest rtk vitest run rtk go test
rtk cargo build rtk tsc rtk lint ```