Repository navigation
Releases
v0.7.1
0.7.1 keeps Langfuse backfill working through Langfuse Cloud's move to v4, prices the current Claude, GPT and Gemini models, and fixes a few things a first run used to trip over. Four of the contributors in this release are new to the project.
Upgrade note: Langfuse Cloud users
Langfuse Cloud goes v4-only on November 16, which removes the observations endpoint tj backfill langfuse used to call. 0.7.1 reads the v2 endpoint with Basic auth, so pass your project's key pair:
tj backfill langfuse --source-url https://cloud.langfuse.com --api-key pk-lf-...:sk-lf-...
A single key, or a rejected pair, now gets a one-line explanation instead of a traceback. Self-hosted Langfuse v3 keeps working. (#787, #790)
Cost correctness
- Current models are priced. Claude Opus 5.5, Fable and Mythos 5.1 and 5.2, Sonnet 5.5 and Haiku 5.5 (with fast mode), the GPT-6 and GPT-5.6 families, and the Gemini 3.x and 4 families, every rate checked against the provider's live pricing page. Before this, calls to those models were priced at a default rate. (#791)
- Sonnet 5 is back to $2 / $10. Anthropic cancelled the price rise scheduled for September 1, so the dated row that applied it is gone.
o3andgemini-2.5-flashnow carry their 2025 price changes as dated rows, so older calls keep the rate that billed them. (#791) - Existing history is not repriced yet. Cost is computed when a span is ingested, so spans already in your database keep the figure they were stored with. New spans are correct from the moment you upgrade. A
tj doctor --repairaction to reprice stored spans is planned for 0.7.2. - Unattributed spend says it may overstate. The bucket can count one call twice when it arrived both live and through a later backfill, and
tj cost,tj status,tj doctor, the API and Lens now say so wherever it appears. (#789) - Shared OTLP traces are attributed to sessions, and spend that can't be assigned to one lands in the unattributed bucket rather than disappearing. (#750)
Product surface
- Mast is an alert channel. (#784)
OTEL_SERVICE_NAMEis respected for theservice.nameresource attribute. (#781)- The verbosity finding names the agent it flagged and a lever you can actually pull, and points at
tj optimize verbosityinstead of a flag that rejected it. (#783)
First-run polish
tj doctorno longer calls a healthy database unwritable. It used to open a second DuckDB connection with different settings, which DuckDB refuses. The misleading "rejected by DuckDB; falling back" warning that fired on every command whiletj serveheld the lock is gone too. (#790)- Lens picks up a changed
index.htmlwithout a server restart. (#778)
Contributors
Thank you to everyone who shipped in this release:
- @volodymyrshk, first contribution: the Langfuse v2 + Basic auth fix, which landed one day before the cutover.
- @JhaSourav07, first contribution: the verbosity remedy rework, through several rounds of review.
- @ki7dk, first contribution: Mast as an alert channel.
- @ardaylmz30, first contribution: hot-reloading Lens.
- @DhruvGarg111: session attribution for shared OTLP traces.
- @ashwmu:
OTEL_SERVICE_NAMEsupport.
Full changelog: v0.7.0...v0.7.1
v0.7.0
The largest release since 0.6. TokenJam has always been able to tell you what your agent sessions
cost. This one starts answering the other half of the question: what those sessions actually
produced.
pipx install --upgrade tokenjam
tj optimize shippedThe shipped-value ledger
tj now records which repo a session ran in and who ran it, then joins each session to the commits
it produced.
- Repo context and developer identity on every session. Remote, repo root, branch and HEAD at
session start and end, the git author email, and a hasheddeveloper_idderived from it. Git
shell-outs are read-only, time-bounded, and never on a request path. A value that cannot be
resolved is absent rather than guessed, so nothing joins on an invented key. - The session-to-commit join. A new
session_commitstable, populated on the daemon's
background pass. Four match sources: agit committool call inside the session (tool_span_git_log),
aTokenJam-Session:orClaude-Session:trailer (trailer_session), a git note naming a
session (git_note), and an AI co-author trailer inside the session window (trailer_window).
The first three aredeterministic; the last isinferred. A row is written once at the best
confidence found and never downgraded. - The
shippedanalyzer.tj optimize shippedreports how many of the window's sessions
shipped a commit to the default branch, the measured cost of the ones that shipped nothing,
rework cost (commits whose added lines were mostly deleted again within 14 days), and loop cost
(repeated Edit/Write calls on one path with no content change). Sessions also carry a state:
shipped, committed, reverted, unshipped, or no repo. - Coverage next to every figure. The share of your default-branch commits that tj could join.
Low coverage means tj is seeing part of your work. It does not mean the rest was unproductive. - Surfaces.
tj optimize shippedin the terminal, a shipped line on thetj statusagent
card,GET /api/v1/shipped, commits and shipped state on the session detail route, and in Lens
the Sessions column and filter, the commit chips with a confidence glyph, the "Shipped this week"
tile and the Optimize page's Shipped card.
Nothing in the shipped finding is a saving. Every dollar in it is measured spend on sessions with
no joined commit, and a session can ship value without a commit: research, review, operations. The
caveat prints on every surface, and the finding sits outside the recoverable-waste rollup.
First run and onboarding
tj initis the primary name. One command object registered under two names, sotj init
andtj onboardtake the same flags, ask the same questions and write the same config. Nothing
abouttj onboardchanged.tj init --hooksinstalls aprepare-commit-msghook in the current repo so a commit you
make from a plain shell mid-session carries aTokenJam-Session:trailer. That joins it to the
session at deterministic confidence, which is the cheapest way to raise coverage. The hook lives
in a managed block, keeps a hook you already have, and refuses acore.hooksPathinside the
worktree because that is a tracked directory.tj init --notesadds apost-commithook that writes the session's measured cost to
refs/notes/tokenjam. It implies--hooksand is off unless you ask for it. tj reads
refs/notes/ai(Git AI) andrefs/notes/exceeds-inktoo, so a repo already annotated by one of
those gets a stronger join with no setup. The hook reads the cost through the daemon, so it skips
in a few milliseconds whentj serveis not running and the commit gets its trailer but no note.tj commit-note [sha]writes that note by hand, for a commit the hook skipped or for a repo
with no hook installed. It never fails the commit it runs from.tj init --enforceturns on the enforcement proxy in suggest mode and prints what it does
and does not touch. Suggest mode forwards every request unmodified and records what a policy
would have done. Nothing is blocked or rewritten until you approve it. Subscription-plan traffic
is never intercepted and subscription OAuth credentials are never proxied or forwarded.tj init --cloud <key> --org <org>connects the machine to a TokenJam Cloud organization.
The daemon then forwards spans, sessions and the commit joins, resumable from a per-stream
high-water mark, so a machine that was offline catches up on its own. Before the first byte
leaves, the command prints what does and does not cross and waits for a yes. Token counts, model
names, cost, timestamps, tool names, file paths, identifiers, the hashed developer id and the git
author email leave. Prompt text, completions, tool outputs, file contents, diffs and secrets do
not, unless you turn on both your local capture toggles andforward_content.
tj init --cloud offstops forwarding in place.- Existing installs fill in. The daemon refills repo context on sessions that were ingested
before any of this existed, andtj init --cloudrefills and matches before its first push. You
get history rather than a ledger that starts the day you upgraded. tj doctorandtj uninstallcover the new surfaces. doctor reports hook state per repo,
whether a hand commit right now would carry a trailer, and whether the Cloud endpoint is
reachable and the key accepted. uninstall strips the managed blocks from every hooks directory tj
wrote to.
Correctness
- An inherited session trailer now ranks below the tool span that ran the commit. A subagent
inherits its parent's session id, so a commit the subagent's own Bash tool ran carried the
parent's trailer and the parent absorbed it at top confidence. Such a row is now written at
inferred. - Remote normalisation drops the query and fragment, and branch endpoints are picked by timestamp
rather than by file order (#762). - The Cloud forwarder resumes in arrival order rather than event order, so a backfill that inserts
spans older than everything already sent no longer loses them. Resume marks are scoped to the
organization and to the database file. A batch the receiver refuses is split until the bad record
is isolated, then skipped and counted, so one row cannot wedge the stream. sessions.updated_atmoves only when a session value actually changes, which stops the bridge
re-sending untouched rows forever.- The transcript catch-up runs once per process, over a window-bounded tool-span index, with
producers keyed by repo. - The serve-mode shim gates its write routes with the ingest secret rather than the optional API
key, and the backfill hand-off goes through the data-access seam instead of around it. tj init --cloudsays so when history leaves without an install id.- Lens: the hero call to action resolves to the surface that renders the analyzer, instead of a
retired route.
Docs
New pages for the ledger, the commit hooks and notes, and the Cloud bridge, plus the ledger OTel
attributes in the architecture reference. See docs/ledger/.
Upgrading
pipx install --upgrade tokenjam, or pip install -U tokenjam in a venv. Schema changes are
additive, so an existing database is migrated in place. Everything new in this release is opt-in:
the hooks, the notes and the Cloud bridge stay off until you run the flag that turns them on.
v0.6.12
Twenty-one commits from nine contributors, six of them shipping their first TokenJam PR.
No schema migration in this release. The upgrade path is clean — verified against a copy of a 6.1GB production database.
Cost correctness
Cache-write tokens are now priced on the alternative side of the quota audit's counterfactual. The actual side already counted all four token classes while the alternative counted three, so every implied saving was inflated by the candidate's full cache-write cost. The headline figure moves down. Thanks @DhruvGarg111.
Session readers across seven surfaces now report the same canonical totals. The sessions list, session detail, /status tiles and archive rows, tj status --json, the MCP server and the session timeline were each omitting cache buckets in different combinations, so the same session could show different numbers depending on where you looked. Also @DhruvGarg111.
MCP get_cost_summary returns complete rows — cache_tokens, cache_write_tokens and call_count — and accepts group_by=tool. The HTTP-proxy path used whenever the database is locked was returning an error for every non-empty summary; it now matches the direct path exactly. Thanks @be-student.
Closed sessions are included in drift baselines again, and tj demo's trace count no longer caps at 50. Thanks @sanmaxdev and @AmirF194.
The statusline tells you more
The driver name stays current without a backfill. The attribution cache is refreshed by the daemon's optimize pass, running from the job's finally so an analyzer failure cannot skip it. A driver past its freshness window now renders with an age marker instead of disappearing, so a dated measurement is labelled rather than silently withheld.
Nudges compose instead of short-circuiting. A session near its context limit whose re-reads come from statically re-injected sources now gets /compact now (window near full), then tj context — previously it received a bare /compact, which cannot reduce re-reads that are re-injected every turn regardless of compaction. An unknown or unrecognised driver no longer suggests /compact at all and points at tj context instead.
Product surface
tj optimize <analyzer> --expand renders full detail for findings below the one-percent significance threshold. The minor-findings pointer advertises the flag; before this it pointed at a command that re-rendered the same suppressed view, so following the advice returned you to where you started. Thanks @be-student.
Session budget and duration alerts fire for llm-only ingest. They were structurally unreachable on any stream without an invoke_agent marker, which describes most raw-OTLP producers, so those checks could never trigger no matter the spend. Thanks @mikemikimike.
Daemon reliability
The daemon no longer treats an unidentifiable process as its own. Where neither /proc nor ps can establish identity, a recycled PID is left alone rather than signalled. A transient resource failure in that probe — a fork failure under memory pressure, say — is now surfaced during tj upgrade instead of being reported as "nothing to restart" while a live daemon keeps running the old version. Both from @be-student.
Build and test infrastructure
CI runs --dist loadscope, keeping each module's tests on one worker. Thirteen module-scoped fixtures across nine files were being rebuilt per worker under the default scheduler. Note for anyone running the suite locally: this flag is now required, and tests/integration/test_xdist_isolation.py fails without it. Thanks @sujalgawas.
A dated pricing row no longer breaks main on a date nobody is watching. Five tests read live rates while asserting introductory numbers, so main went red the morning claude-sonnet-5's introductory pricing expired, days after the last green run.
The relearn API tests clear the compute flag the routes actually read. The isolation fixture had been clearing a different module's threading.Event, so the flake it was written to prevent kept firing and kept reddening contributor pull requests.
Contributors
@sujalgawas, @mikemikimike, @AmirF194, @be-student, @DhruvGarg111, @sanmaxdev, @syf2211 and @Yukitty. Six of you sent a first PR to TokenJam in this cycle; @be-student landed four and @DhruvGarg111 two. Thank you.
Upgrading
pipx upgrade tokenjam
v0.6.11
v0.6.10
What's Changed
- Three silent-failure fixes: launchd registration and ingestion staleness, npm/PyPI publish race, UTC day bucketing by @anshss in #715
- fix: gate npm wrapper publish on PyPI visibility, fail closed on unresolved pin by @anshss in #713
- Fix UTC day bucketing and a lying cast in the API read path by @anshss in #714
- Fix #616: Refresh Review inbox relearn cache from tj optimize by @Axiya3749 in #701
- Package tokenjam as a Claude Code plugin by @anshss in #716
- docs: fix comments citing unrelated issue #17 for cache-write-token work by @laishettikarthik-tech in #717
- feat: add mocked-HTTP coverage for contributor_label_guard I/O by @syf2211 in #633
- fix(guard): diagnose API status before payload shape (#608 follow-up) by @anilmurty in #719
- fix(cli): fail fast when --export-templates omits reuse finding by @syf2211 in #634
- Add a plugin marketplace manifest and put the plugin version in release lockstep by @anshss in #720
- chore: bump version to 0.6.10 by @anshss in #721
New Contributors
- @laishettikarthik-tech made their first contribution in #717
Full Changelog: v0.6.9...v0.6.10
v0.6.9
Patch release.
- Bound DuckDB memory: the per-span system prefix is now stored as a fingerprint rather than the whole file, and the buffer pool has an explicit ceiling sized for the daemon.
Full diff: v0.6.8...v0.6.9
v0.6.8
What's Changed
- fix(db): a fatal DuckDB error must stop the process serving, not be logged per-row by @anshss in #700
- fix(db): recover off the recorded fatal, and never expose a half-torn-down backend by @anshss in #702
- ci: parallelize pytest with pytest-xdist by @anshss in #706
- Extend deadweight's plugin lane: recency-based liveness, agent/MCP pricing, honest gating by @anshss in #704
- Port the Lens dashboard, session detail and analyzer pages to the new design system by @anshss in #699
- Disable the summarize analyzer for the SDK persona by @anshss in #703
- Remove write-budget gate: apply is offered whenever a finding is apply_capable by @anshss in #707
- Break analyzer explanation prose into readable paragraphs by @anshss in #708
- fix(optimize): downsize claude-code card honesty + subagent evidence fix by @anshss in #709
- chore: bump version to 0.6.8 by @anshss in #710
Full Changelog: v0.6.7...v0.6.8
v0.6.7
What's Changed
- chore: remove v0.4.x release artifacts and compress CLAUDE.md by @anshss in #683
- relearn: stop inventing root causes for text-less failures, and four defects around it by @anshss in #684
- fix(summarize): fence the source from the rewrite instruction, and close the vacuous structure gate by @anshss in #685
- fix: subagent-type linkage, SDK streaming, session provenance, doctor + mcp hardening by @anshss in #686
- docs: remove stale issue references from prose by @anshss in #687
- One derivation per published value: rollup completeness, one write budget, cycle provenance, and a seam registry by @anshss in #688
- Remove verified-redundant tests, preserve two boundary assertions by @anshss in #690
- Measure the MCP schema tax per server, ingest the agent-config surface, make prune/expire performable, and close the fix-prose guard's escapes by @anshss in #689
- Mechanize the aggregate-versus-parts check, and stop three surfaces asserting more than their data supports by @anshss in #692
- Add a universal CLI loading state (fixes silent tj optimize / tj status) by @anshss in #693
- [feature] tj optimize: scoreboard by default, full cards behind -v by @anshss in #691
- perf(status): tj status ran 12 analyzers inline for its footer line by @anshss in #694
- Fix onboarding writing an unreachable OTLP endpoint, and detect it in doctor by @anshss in #696
- fix: reuse/script cost cards no longer double-claim clustered sessions by @anshss in #695
- Add a total tile to the optimize row, and stop wide Lens tables overflowing the page by @anshss in #697
- chore: bump version to 0.6.7 by @anshss in #698
Full Changelog: v0.6.6...v0.6.7
v0.6.6
A CLI + Lens polish release from a round of fresh-install testing. No analyzer or back-end logic changed, so upgrading is safe on any existing store.
CLI polish
tj uninstallno longer prints a contradictorypip uninstall tokenjamafter pipx already removed the package — thetjshim symlink is resolved so a pipx install isn't double-counted. A genuinely separate pip install is still reported alongside pipx.tj tokenmaxxandtj contextstopped repeating the overhead/work percentages;tj contextalso states the "reference this file as@path, or add it to CLAUDE.md" instruction once instead of on every file.tj onboard --claude-codehas a cleaner completion screen: three✓checks (config / observability / sessions backfilled), a privacy note, next steps, and the macOS background-items heads-up at the bottom. A daemon-restart failure is now surfaced instead of hidden behind a green screen.- The startup wordmark reads "TokenJam" cleanly (the lowercase
nno longer looks like anm).
Lens
- The Optimize "Spend by component" chart's y-axis labels render properly instead of clipping to
0.0000. - The Optimize submenu is persona-aware: it re-derives when you switch persona and shows nothing for a persona with no data, so Claude Code items no longer linger under the SDK view.
Install / upgrade
pipx install tokenjam # first time
pipx upgrade tokenjam # existing install
v0.6.5
A Lens (web UI) polish release. No analyzer or back-end logic changed, so upgrading is safe on any existing store.
Lens: one flow from waste to fix
- Optimize is now a summary landing plus a per-analyzer detail page for each finding, and the fix you apply lives on that detail page, right under the evidence that found it.
- The Dashboard Opportunities tiles link straight into those detail pages, so "here is the waste" and "here is the change to make" are a single flow instead of two separate screens. The standalone Review-actions page is retired; nothing you could do there is gone, it just moved next to the evidence.
- Persona-consistent navigation and headers across Dashboard, Optimize, and Sessions.
Sessions page cleanup
- One Sessions heading, with the persona dropdown sitting bare beside it, matching the Dashboard and Optimize.
- The archived-session table gains an Agent column and drops the redundant status dot and "completed" badge.
- A session with a single trace now renders its span waterfall inline in the Traces tab, with no extra click, and a rolled-up conversation is labelled as such instead of by its first span.
- Session detail tabs reordered so Traces leads.
Onboarding
- Shorter, cleaner Claude Code post-onboard output.
Docs
- README refreshed for the two personas, the fix lifecycle, and the current analyzer set. Thanks @anshss.
Install / upgrade
pipx install tokenjam # first time
pipx upgrade tokenjam # existing install