Command reference
Every TokenBuild command in one place. Run CLI commands as npx tokenbuild <command> in a terminal at the root of your repo (or tokenbuild <command> inside Claude Code, where the plugin puts it on the PATH). Run npx tokenbuild with no command to see the three command groups in your terminal.
Every command is explained in depth, with examples, in the Help manual.
Download the full manual (PDF)129 pages · 2.7 MB
The free waste audit works without an account. Everything else needs an active trial or plan; without one, hooks and tools step aside and Claude Code works as normal.
Three products, three command groups
Commands are grouped under TokenBuild's three products. Each grouped command also works under its short name, shown in its description (for example save run or just run), so existing scripts keep working. npx tokenbuild <group> lists a group's commands; npx tokenbuild help all lists them all.
| Group | Product | What it covers |
|---|---|---|
save | Token Saver | Read less, write less, waste fewer turns, and count every token saved. |
team | Team Build | Task and project state, project planning and budgets, Team Relay and the team plan. |
learn | ML Validation and Economics | Test selection, change risk, what TokenBuild learned, the control-group proof, strategies, recipes and repo shape. |
Get started
| Command | What it does |
|---|---|
audit [--days 30] [--project name] [--json] | Free. Price the token waste in your recent Claude Code sessions and show where it came from. |
install [key] | Install the TokenBuild plugin into Claude Code or the Claude app, save your key and check your plan, in one step. |
release update | Update the Claude Code plugin to the latest version, keeping your CLI key. Restart Claude Code afterwards. |
login [key] | Connect this computer to your plan. Get the key from your CLI key page. |
logout | Remove the saved key from this computer. |
init [--route balanced|lean|off] [--no-format] | Add TokenBuild's hooks, MCP tools, model routing and rules to this repo, if you are not using the plugin. Safe to run again: it only touches its own entries. |
doctor | Check your plan and which tools are on in this repo, and get the one thing to do next. |
Token Saver: save
Keep what wouldn't help out of Claude's context, cut what Claude writes, and measure every saving.
Read less
| Command | What it does |
|---|---|
save run <command> | Short: run. Run a noisy command (tests, builds, installs, linters). Prints the errors and a summary; saves the full log to .tokenbuild/logs. |
save index | Short: index. Build or refresh the local repo index (files, symbols, imports) that map, find and pack use. |
save map [--budget 2500] | Short: map. Print a compact map of the repo: the most-imported files and their main symbols. |
save find <name> | Short: find. Locate a symbol or file. Returns path:line. |
save pack "<task>" [--budget 4000] | Short: pack. The files and symbols a task most likely needs, with line numbers, under a token budget. |
save docs <symbol> | Short: docs. Docs for a library symbol at the version installed in your project (JS "pkg#name", Python, Go). |
save boost [on|off] [--model name] | Short: boost. Local Boost: a free model on your own machine (Ollama) reads big files and logs so Claude doesn't have to. |
save ask "<question>" <file> | Short: ask. Ask the local model a question about a file. |
Smaller sessions and setup
The tune commands show what they would change. Add --apply to make the change.
| Command | What it does |
|---|---|
save handoff | Short: handoff. Save a handoff note so a fresh session picks up where you are, for far fewer tokens than a long chat. |
save fresh [on|off] [--every N] | Short: fresh. Adaptive Fresh Start: learned clear-or-continue advice every N prompts (1–10000, default 5), with its decisions and measured savings. |
save profile | Short: profile. What fills Claude's context right now, and how much of it is dead weight. |
save tune permissions [--apply] | Short: permissions. Commands you approve every time, turned into allow rules. |
save tune diet [--apply] | Short: diet. MCP servers whose tool definitions cost tokens every turn but go unused. |
save tune claudemd [--apply] | Short: claudemd. Move folder-specific CLAUDE.md sections into that folder, so they load only when needed. |
Measure and sync
| Command | What it does |
|---|---|
save stats [--json] | Short: stats. Savings in three separate tiers (measured, estimated, proven), TokenBuild's overhead and break-even against your plan, then activity tool by tool. |
save overhead [--json] | Short: overhead. TokenBuild's own cost: hook latency (p50/p95 against 50 ms), context added per session, nudges against the budget. |
save meter [--json] | Short: meter. Real metered tokens and cost, from Claude Code's own usage records. |
save sync [--all] | Short: sync. Send counts to your dashboard now (it also syncs every 30 minutes during a session and when it ends). --all: every repo on this computer. Counts, hashes and, on Team plans, file paths: never code, file contents, prompts or error text. |
save autosync on [--every 15]|off|status | Short: autosync. Keep the dashboard current with no session open: a scheduled job syncs every repo every N minutes. |
Team Build: team
Keep the goal, plan and decisions outside the conversation, plan projects, and coordinate every Claude on your team.
Task, project and plan
| Command | What it does |
|---|---|
team task [--reset] | Short: task. Show the task state TokenBuild keeps for handoffs and subagents: goal, plan, files changed, checks. |
team state [--decide <text>] [--forget <n>] | Short: state. Project state: decisions, recent work, where work happens and what's open. Record or forget a decision. |
team preflight "<goal>" [--steps "a; b"] | Short: preflight. Plan a project: files, tests, estimate, dependencies and stages per step. |
team autopilot "<task>" [--budget <n>] | Short: autopilot. Token budget for a task, split across planning, coding, testing and correction, with an 80% range. |
team plan [run [--yes] [--max <n>]] | Short: plan. Team plan for this repo by stage; run works through your ready items with Claude Code. |
Team Relay
On Team plans: see teammates' live sessions, share a plan and pass tasks between people.
| Command | What it does |
|---|---|
team relay | Short: relay. Show teammates' live sessions in this repo. |
team relay send <name> [--note ...] [--contract] | Pass your current task to a teammate, with an optional note. --contract drafts a Verified Handoff Contract for review on the dashboard. |
team relay share | Share your plan with the team. |
team relay claim <n> | Claim a plan step. team relay done <n> marks it done. |
team relay name <you> | Set the name teammates see. |
ML Validation and Economics: learn
Models trained on your own repo's history check the work and decide where tokens pay off.
Validation
| Command | What it does |
|---|---|
learn verify [file] | Short: verify. Run only the tests a change to file can affect, riskiest first, with flaky-test reruns. With no file, show the last result. |
learn risk [--incident "<error>"] [--install-hook] | Short: risk. How risky the current change is before you push, why, and what to run first. With an error message: where a production incident should start. |
Economics
| Command | What it does |
|---|---|
learn [--reset] | What TokenBuild has learned here: policies and their off-policy checks, tips, test history, drift, field measures and evolved flags on trial. --reset clears it. |
learn proof | Short: proof. Each feature's measured effect, compared with control-group sessions where it was held off, with a 95% interval: a proven saving or "insufficient evidence". |
learn replay [strategy...] [--task "<task>"] | Short: replay. Compare execution strategies on this repo's measured history, ranked by tokens to a verified result. |
learn recipes [--compile] [--remove <name>] | Short: recipes. Versioned skills TokenBuild wrote from verified work you repeat, with their measured uses and why any were retired. |
learn shape [--plan <n>] | Short: shape. Which files cost the most for Claude to read, and a plan to split or co-locate them, with guardrails (security-sensitive and generated files held back, tests first). |
Tools Claude calls
The plugin gives Claude these MCP tools. Claude picks them up by itself; you can also ask for one by name, for example "use tb_brief for this task".
| Tool | What it does |
|---|---|
| Token Saver | |
tb_brief | A short brief for a task: likely files with line numbers, related files, the tests to check, past fixes. |
tb_map | Compact map of the repo, instead of exploring with Glob and LS. |
tb_find | Find a symbol or file; returns path:line so Claude reads only that range. |
tb_pack | The files and symbols a task needs, under a token budget. |
tb_edit | Replace a range of lines without writing the old lines back out. |
tb_apply | Codemod: one find/replace across many files, applied locally, with a compact summary. |
tb_docs | Library docs at the version installed in your project. |
tb_memo | Saved answers about the repo, returned only while the files they rely on are unchanged. |
tb_profile | What fills the context window right now, and how much is dead weight. |
tb_digest | Ask the local model (Local Boost) about a big file or log, at zero Claude tokens. |
| Team Build | |
tb_task | Live task state, so a new session or subagent resumes at once and parallel agents can split a plan. |
tb_preflight | Plan a project before starting: files, tests, estimate, dependencies and stages per step; can share it to the team plan. |
tb_autopilot | A token budget split by phase for a task, learned from the most efficient similar tasks here. |
| ML Validation and Economics | |
tb_verify | Run only the affected tests and get one line back: pass, or the failing assertion and a log path. |
tb_risk | Change risk before a push, PR or deploy; or, given a production error, where to start. |
tb_replay | Compare execution strategies on this repo's history before choosing one. |
tb_shape | Which files cost the most to read, and what to split. |
Skills in Claude Code
Type these in Claude Code once the plugin is installed.
| Skill | What it does |
|---|---|
/tokenbuild:setup | Check that TokenBuild is ready in this project, and the one thing to do next. |
/tokenbuild:audit | Free waste audit of your recent sessions. |
/tokenbuild:stats | Tokens kept out of context in this repo, tool by tool. |
/tokenbuild:handoff | Save a handoff note before starting a fresh session. |
/tokenbuild:index | Build or refresh the repo index. |
/tokenbuild:boost | Turn Local Boost on or off. |
/tokenbuild:rules | TokenBuild's token-saving way of working; Claude loads it before tests, builds and searches. |
The plugin also adds a scout subagent: a fast, low-cost explorer Claude sends to find where things are and read big files or logs.
Runs by itself
You don't need to type these. Claude Code runs them through the hooks TokenBuild installs.
| Command | What it does |
|---|---|
hook post|prompt|stop|start|precompact|end | One hook per Claude Code event: Context Ledger, Verify Loop, Task Brief, Next-Read, Fingerprints, Task State, Loop Breaker, Repo Memory, Fresh Start, the learning layer and the session-end sync. |
guard [--reset] | Waste Guard and Edit Preflight: stops reads of generated or vendored files and edits that would break. --reset clears a session's guard and Context Ledger state. |
format [--track] | Formats edited files with your project's own formatter. |
mcp | Starts the MCP server that provides the tools Claude calls. |
Questions? See the FAQ or contact us.