Are you TokenMaxxing hard enough? Find out in less than a minute →

Quickstart

Peek in 15 seconds with no install, then pick the path that matches your agent, whether that's Claude Code, Codex, a Python SDK/API agent, or any OTel emitter.

Peek first, no install

Point TokenJam at the Claude Code session logs already on your disk. Nothing is written, no daemon runs, no config is created.

npx tokenjam        # or:  uvx tokenjam

It reads ~/.claude/projects/*.jsonl into a throwaway in-memory database and prints your quota composition and a session timeline. When you want to keep it, install the full product below and pick your path.

npx tokenjam and uvx tokenjam shell out to the Python CLI via uvx or pipx, so you need one of those runners on your machine. See Install & upgrade for the runner requirements and the full matrix.

What are you running?

You are…Run thisYou get
A Claude Code userpipx install tokenjam && tj onboard --claude-codeBackfilled history, a zero-token statusline, all six analyzers + the Lens dashboard
A Codex CLI userpipx install tokenjam && tj onboard --codexThe same onboarding flow, wired for Codex’s session logs
A Python SDK / API agent devpipx install tokenjam && tj onboard + @watch() in your codeLive capture from your own agent process
Any OTel-emitting agentPoint your OTLP exporter at tj serveZero-code ingestion, no SDK and no patch

Each path below ends with a verify step.

Claude Code

Two commands wire up every session (costs, tool calls, API requests, errors) with zero code changes.

pipx install tokenjam
tj onboard --claude-code
# Restart Claude Code, then verify:
tj status --agent claude-code-<project>

Onboarding creates a shared config, backfills your recent session history, installs the background daemon, and wires a zero-token statusline that shows this session’s re-read share with a /compact nudge. It does not register an MCP server — that’s an SDK/API surface, and an in-loop MCP would tax every turn.

Full guide: Claude Code & Codex.

Codex

One command, run once globally. Codex is project-agnostic, so you don’t repeat it per repo.

pipx install tokenjam
tj onboard --codex
# Restart Codex, then verify:
tj status --agent codex_exec

Codex writes to its single global config (~/.codex/config.toml), so every session lands under one agent ID. Telemetry flows in over OTel and you read it with the tj CLI.

Full guide: Claude Code & Codex.

Python SDK / API agent

For any Python agent: Anthropic, OpenAI, Gemini, Bedrock, and 10+ frameworks.

pipx install tokenjam
tj onboard    # creates config, generates the ingest secret
tj doctor     # verify your setup

Add two lines to your agent. patch_anthropic() intercepts every Anthropic call automatically, and @watch() opens a session span around your run.

from tokenjam.sdk import watch
from tokenjam.sdk.integrations.anthropic import patch_anthropic

patch_anthropic()

@watch(agent_id="my-agent")
def run(task: str) -> str:
    # your agent code, nothing else to change
    ...

One-line patches exist for every major provider and framework. See Python SDK for the full list. Building on a framework? pip install tokenjam[langchain] (or [crewai] / [autogen]) plus one patch_*() call gives you framework-level spans.

Any OTel-compatible agent

Already emitting OpenTelemetry? Point your OTLP exporter at a running tj serve. No SDK, no patch.

tj serve &
export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:7391/v1/traces
# run your agent as usual, then verify:
tj status

Many runtimes already ship OTel support out of the box.

FrameworkOTel support
Claude CodeBuilt-in: tj onboard --claude-code
LlamaIndexopentelemetry-instrumentation-llama-index
OpenAI Agents SDKBuilt-in
Google ADKBuilt-in
Strands Agent SDK (AWS)Built-in
Pydantic AIBuilt-in
Semantic KernelBuilt-in

Next steps

Once telemetry is flowing, run tj optimize for savings findings, tj serve for the Lens dashboard, or tj tokenmaxx for a shareable efficiency card. To install differently or upgrade later, see Install & upgrade.

Get TokenJam updates