Skip to content
Token Controller Docs
Docs / Connect agents / CLI

CLI

You may want to see what your own agent sessions cost, with or without your organization. The CLI, tc, reads session files, splits sessions with your rules, and submits. It works with no service connected.

Install

# macOS and Linux
brew tap tokencontroller/tap https://github.com/tokencontroller/tokencontroller
brew install tc
# Windows: tc-x86_64-pc-windows-msvc.zip from the GitHub releases

Binaries for macOS, Windows and Linux, on Intel and ARM, are on GitHub.

Connect, or stay local

tc connect https://app.tokencontroller.com/i/kestrel-4f2a # your invite link
tc status

Without tc connect the CLI keeps everything on your machine. It still splits sessions with your personal rules and shows reports. tc ships no prices: offline it prices with your own table, set with tc config price-table; connected, it uses the service's.

Everyday commands

tc review # your sessions since the last submit and where they were put
tc tag 5 feature=KD-231 # set a tag on session 5 by hand
tc submit # submit everything since your last submit
tc report --by team # cost per value of any tag or attribute (default: feature)
tc export --csv # every message as CSV, for a spreadsheet

With no service, the export is enough to report by hand. Every command and setting is in the CLI reference.

Only some folders

If you work for several clients, or want one project counted, track its folder:

tc list # the folders your sessions ran in
tc track ~/work/storefront # count only sessions there and below

Without a tracked folder, tc counts every session on the machine. The first time you run it at a terminal, it asks whether to track the folder you are in. Sessions the Claude Code mod reports always count. Details are in the CLI reference.

What it reads

Session files of Claude Code and Codex, counted the way the open source ccusage project counts them: one message per model call, with its token counts by kind. Every other agent reports by telemetry or through the token entries endpoint. Reading the same files twice changes nothing, so run it as often as you like. There is no background process and no sync between your machines: each machine submits its own messages.

What it sends

tc submit sends each session as a token entry: its messages, the working directory, the branch, the feature keys found in your prompts, and the tags and splits it set. It never sends prompt text.

Claude Code Codex
Provider None; the session file names none. The provider Codex reports, such as openai.
Sign-in The organization of a claude.ai or Console sign-in, as Claude Code wrote it at session start, as the signal organization.id. Nothing for an API key. Nothing.

tc never puts today's sign-in on a session that started earlier. A message without a provider is priced when every provider in the price table charges the same for its model; see Price table.

Last updated 27 November 2026 · Edit this page© 2026 Jan Beck · Privacy · Imprint