TokenJam ingests telemetry data about your agents from a multitude of sources and provides you a quick and easy way to visualize and optimize cost so that you get the most out of the tokens you pay for.
Get started
One command sets up live capture:
npx tokenjam onboard # or: pipx install tokenjam && tj onboard
tj init is the same command (tj onboard is its original name, still there). It asks how you use AI agents and wires that path: live capture, the analyzers your setup can act on, and Lens. Coding-agent users (Claude Code, Codex) also get their recent history backfilled and a zero-token status line wired in; restart the agent and you're live. SDK and API users add @watch() to their own code, or point an OTLP exporter at tj serve.
Then open the dashboard:
tj serve # Lens, at http://127.0.0.1:7391/
It opens on your spend so far: which models, which sessions, where it went and proposed fixes. Prefer the terminal?
tj optimize # what your usage is costing, and where it is recoverable
tj rules list # the fixes that came out of it, and the files they'd land in
tj rules list reads the last analysis, so run it after tj optimize or after the daemon's first cycle. Not sure what to do next? Bare tj always points at the next useful command.
Just looking? npx tokenjam prints a read-only report over the logs you already have. No install, nothing kept.
Claude Code plugin
TokenJam also ships as a Claude Code plugin — see plugin/ for the plugin source (plugin/.claude-plugin/plugin.json) and install instructions. It adds slash commands that wrap the tj CLI; it does not install anything on its own, so tj still needs to be on your PATH (npx tokenjam@latest or pipx install tokenjam).
/plugin marketplace add Metabuilder-Labs/tokenjam
/plugin install tokenjam@tokenjam
/tokenjam:onboard # wires the statusline, resume-brief hook, and local telemetry ingest — same as `tj onboard --claude-code`
/tokenjam:status # tj status
/tokenjam:optimize # tj optimize
/tokenjam:doctor # tj doctor
/tokenjam:uninstall # tj uninstall --yes
The plugin deliberately does not ship its own hooks or an .mcp.json: the statusline and hooks are wired by /tokenjam:onboard calling the existing, idempotent tj onboard --claude-code, so there's exactly one writer of ~/.claude/settings.json. TokenJam's MCP server (tj mcp) also stays opt-in and out of this plugin's default install — it's built for SDK/API integrations that already sit in the request path, not for Claude Code, where an in-loop MCP measurably taxes every turn.
Which path are you?