Documentation

TokenBuild is a plugin for Claude Code. It handles the work that shouldn't cost tokens, such as reading logs, finding files and re-sending long chats, with plain code on your machine. It comes as three products: Token Saver cuts the tokens each task uses, Team Build plans the work and coordinates every Claude on a team, and ML Validation and Economics learns from your repo's history to check the work and prove what each saving is worth.

This page is the overview. The Help manual covers everything in depth.

Download the full manual (PDF)129 pages · 2.7 MB

Quick start

You need Claude Code with a Claude Pro, Max, Team or Enterprise plan, or an Anthropic API key. TokenBuild never asks for your Claude login.

  1. See your waste (free, no account). In a terminal, run npx tokenbuild audit. It prices the avoidable waste in the session logs Claude Code already keeps on your machine. Nothing is uploaded.
  2. Start your trial. Create an account and choose Solo or Team. The 30-day trial costs $5, credited to your first payment. See Pricing.
  3. Install. Open your CLI key page, create a key and copy the one line shown for your system:
    • Windows: paste it into PowerShell.
    • Mac or Linux: paste it into Terminal.
    It installs anything missing (Node.js and Claude Code's command line, from official sources), then the TokenBuild plugin, saves your key and confirms your plan. Already have Node.js? npx tokenbuild install <key> does the same.
  4. Restart Claude Code. The plugin's hooks, tools and skills load when Claude Code starts.
  5. Check it. In Claude Code, type /tokenbuild:setup, or run npx tokenbuild doctor in your repo. Either one shows your plan, what's on in this repo and the one thing to do next.
  6. Work as usual. There's nothing new to learn: TokenBuild works through Claude Code's hooks. Your dashboard updates every 30 minutes while a session is open, and again when it ends.

Updating. Run npx tokenbuild release update, or in Claude Code's terminal claude plugin marketplace update tokenbuild then claude plugin update tokenbuild@tokenbuild. Restart Claude Code afterwards.

What happens in a session

TokenBuild runs one small process per Claude Code event. Hooks finish in milliseconds and never wait on the network.

WhenWhat TokenBuild does
Session startsRefreshes the repo index in the background. Injects the project state (decisions, recent work, what's open) after /clear, or the handoff note if one is waiting. Runs the weekly setup check.
You send a promptAdds a short brief: likely files with line numbers, the tests to check and past fixes there. Adds the budget forecast with an 80% range, saved answers that are still valid, and a learned tip. Offers a fresh start first if the prompt cache expired on a huge conversation. When you ask to push or ship, it adds the change's risk.
Claude reads or searchesWaste Guard blocks lockfiles, build output and huge whole-file reads. The Context Ledger answers repeat reads of unchanged lines with "already in your context", or with only the lines that changed. Next-Read offers the outlines of the files that usually come next.
Claude editsEdit Preflight syntax-checks the edit before it lands. The Verify Loop runs the tests that edit can affect, in the background, and reports one line.
Claude runs a commandNoisy test, build and lint output is condensed to the errors and a summary; the full log stays in .tokenbuild/logs. A command that fails the same way three times triggers the Loop Breaker.
Claude finishes a replyFormats edited files with your own formatter. Records decisions. Warns once if a task is heading for trouble (early warning), runs far past its budget, or the conversation has grown big enough that a fresh start is cheaper.
Session endsCloses the last task so it is measured, then sends the session's counts to your dashboard.

The three products

Every TokenBuild feature belongs to one of three products, and each product has its own command group: tokenbuild save, tokenbuild team and tokenbuild learn. The older single-word commands still work. Most features run by themselves through Claude Code's hooks with nothing to type. See the command reference for every command.

ProductWhat it doesCommands
Token SaverKeeps what wouldn't help out of Claude's context, cuts what Claude writes, avoids wasted turns, and counts every token saved.save
Team BuildKeeps the goal, plan and decisions outside the conversation, plans projects, and coordinates every Claude on a team.team
ML Validation and EconomicsModels trained on your repo's own history check the work and decide where tokens pay off, and prove it.learn

1. Token Saver

Commands: tokenbuild save (run, index, map, find, pack, docs, boost, ask, handoff, profile, tune, stats, meter, sync, autosync).

Read less

Write less, waste fewer turns

Measure

2. Team Build

Commands: tokenbuild team (task, state, preflight, autopilot, plan, relay).

For every developer

On Team plans

Team plans add Team Relay and the Team dashboard. Each teammate installs TokenBuild as in the quick start.

  1. Create the team. Choose the Team plan at signup, or open the Team dashboard on a Solo plan and upgrade. Your existing subscription is prorated.
  2. Invite people. In People, choose Invite people and send the link or code. Teammates can also ask to join with the owner's email. Every request waits for an admin, who approves it as coder or viewer.
  3. Set roles. Admins approve requests, change roles, invite people, set the Team Relay level and manage billing. Coders add, assign and finish plan items, set dependencies, specs and stages, hand off tasks and add projects. Viewers see the board, plans, people, handoffs and savings. The owner is always an admin, and whoever adds a project is its admin.
  4. Turn on level 2 (Overview → Team Relay). It shares task goals, the plan, saved answers and handoff notes. The board, plans and handoffs need it. Level 1 shares only names, branches, edited file paths and error hashes.
  5. Add projects. New project takes a name, the code repo link and a link to project files. It lines up with teammates' sessions in that repo automatically.
  6. Plan the work. Add items to a project's plan. Set after # for dependencies, assign people, and write a spec for each item (done when, constraints, files to start with). Items group into stages by their dependencies.
  7. Deploy stages. Deploy stage sends each ready, assigned item to its person's next Claude prompt as a staged task, with its spec. Turn on auto to send the next stage once everything in the current one is done and verified. Each teammate can also run tokenbuild team plan run to work through their ready items with Claude Code.
  8. Hand off. Pass a task from the dashboard (Handoffs) or a session (tokenbuild team relay send <name>). The teammate's next Claude prompt in that repo starts from your state, and they're emailed from tasks@tokenbuild.ai.
  9. Connect GitHub (Admin, optional). A repository or organization webhook adds pull requests, review blockers and CI states, linked to plan items and sessions. Metadata only, no token, no code access.
  10. Watch the Conflict Radar and the brief. The Overview lists prioritized actions, each with its evidence and owner. The radar flags overlapping changes, shared high-risk modules, conflicting ownership and out-of-order work. Act on an alert, or dismiss it with a reason.
  11. Keep team knowledge. Decisions a Claude session states arrive as drafts. Once an admin approves them, they reach every session in that repo (Team Knowledge).
  12. Hand off with a contract. team relay send <name> --contract drafts the nine-field handoff from local state. Review it in Agents & Sessions, and it's sent verified only with fresh passing tests.
  13. Run experiments, carefully (0.20.3). Admins propose a workflow change, approve it and let it run for half the team. An independent Judge decides with a 95% interval, and a kill switch stops everything. The Engineering graph, evidence grades and a research delivery forecast are in Work & Planning.
  14. Use the insights. The dashboard flags likely collisions before the first edit, teammates on coupled code who never coordinate, at-risk tasks and who could help. It suggests dependencies and assignees (accepting or dismissing a suggestion teaches it) and shows pooled estimate accuracy, who knows what, and which parts of a handoff note save the most.

Team Memory. Everyone's Claude learns from the whole team's history on the same repo: which files tasks change and which errors they fixed. Only file paths, counts and one-way hashes are shared.

Two Claudes can't claim the same plan item: the second claim is refused, and the work it didn't repeat is credited as a coordination saving, as is a picked-up handoff.

3. ML Validation and Economics

Commands: tokenbuild learn (verify, risk, proof, replay, recipes, shape; learn alone shows what it learned).

Code validation: tests

The Verify Loop runs only the tests an edit can affect, picked from your import graph, in the background, with one line back (learn verify, tb_verify). It supports Vitest, Jest, node --test, pytest and go test. Any other runner works with "verify": "your command {files}" in the config.

Code validation: before you ship

Project economics

How TokenBuild learns

All learning runs on your machine, from this repo's own measured tasks. Run tokenbuild learn to see what it has learned; tokenbuild learn --reset clears it (measured tasks are kept).

Configuration

Settings live in .tokenbuild/config.json at the root of each repo. They're all optional.

SettingDefaultWhat it does
holdout10Percent of sessions that hold one feature off for the savings proof. 0 = off.
learntrueThe learning layer (policies, tips, brief size). false = fixed behavior.
briefSizelearnedPin the number of likely files in the brief.
brief, memorytruefalse turns off the Task Brief, or Repo Memory and the brief.
autopilot, earlyWarntrueBudget split and its warnings; the early warning.
verifyautoA test command with {files}, or false to turn off the Verify Loop.
verifyFullautoThe full-suite command for tb_verify scope "full".
testSelect, flakyRerun"tokens", truePredictive test selection (learned order; token-aware skipping, "time" to skip for speed, false off); rerun-on-failure for flaky tests.
briefGate0.75Hold the brief back when its calibrated chance of naming the right file is below this; false = always show.
risktrueThe change-risk line when you ask to push or ship.
handoff, handoffAttrue, 100000Fresh Start, and the conversation size (tokens) at which it's offered.
shareDecisions, experimentsfalse, trueShare this machine's stated decisions as Team Knowledge drafts (consent); take part in team workflow experiments.
adaptiveFresh, freshEvery, freshMintrue, 5, 20000Adaptive Fresh Start; how often it decides (1–10000 prompts); the smallest conversation it advises on (tokens).
cacheKeepertrueOffer a fresh start before re-caching a huge conversation after a break.
syncEvery, syncOnEnd30, trueMinutes between dashboard syncs during a session (0 = off); sync at session end.
shareLearning, shareFingerprintstrueCross-user priors (noised counts); global fingerprints (hashes and config file names).
shareField, trialtrue, 10Send field measure counts (V-op, V-dur, turnover); percent of sessions that trial an evolved flag (none ship in 0.20.0).
teamMemory, relaytrueTeam plans: shared Repo Memory; Team Relay for this repo.
autoTunefalsetrue applies the weekly setup check's findings instead of only suggesting them.
boostfalseLocal Boost (set with tokenbuild boost on).

Privacy in short

Your code, file contents, prompts and Claude conversations never leave your machine. Sync sends counts: per-tool daily totals, per-task token totals for the savings proof, noised learning counts, and one-way error hashes with the names of well-known config files that fixed them. On Team plans, teammates also see file paths, branches and, at level 2, task goals and plan titles. Full details are in the Privacy Policy and on the Security page.

Help and troubleshooting

The tb_ tools or skills don't show up.
Restart Claude Code after installing or updating. Then run /tokenbuild:setup; it names what's missing.
"No active plan".
Check Billing. Then run npx tokenbuild login <key> with the key from your CLI key page. Without a plan, every hook steps aside and Claude Code works as normal.
The Verify Loop never reports.
It needs a supported runner (see Testing) and test files it can link to your code through imports or matching names. Set "verify" for anything else.
The dashboard looks out of date.
It syncs every 30 minutes during a session and when a session ends. Run npx tokenbuild sync to send now.
A learned behavior doesn't suit you.
See it with tokenbuild learn, clear it with tokenbuild learn --reset, or pin it with the settings above.
Uninstall.
In Claude Code's terminal, run claude plugin uninstall tokenbuild@tokenbuild. Delete the .tokenbuild folder in a repo to remove its local data.

More: the command reference, the FAQ, and contact (support@tokenbuild.ai). Toki, the assistant in the corner of every page, answers common questions instantly.