The same Claude Code for up to 38% less

Replays your own past sessions to show what each change would have saved, then changes only what you pick.

A real session, recorded live. Your saving depends on how you work: see the proof.

How it works

See, look, fix, slide, keep, undo

See

Your number first

Replays your own sessions at smaller windows, before anything changes: /tokendoctor:sessions.

$ tokendoctor-replay --days 45334 sessions in the last 45 days. Had Claude Code compacted at a smaller window:   200K   15.5% of all cost saved  (111 sessions affected, 861 compactions more)   300K   14.7% of all cost saved  (88 sessions affected, 364 compactions more)   400K   11.1% of all cost saved  (69 sessions affected, 175 compactions more)   600K   7.3%  of all cost saved  (41 sessions affected, 61 compactions more)An estimate: it cannot see the work a model does again after a summary.

Look

Every token, on one page

By day, model, effort, main thread and each subagent, context size and project. One local file: /tokendoctor:dashboard.

The author’s tokendoctor dashboard: 57% of the spend was Claude re-reading the conversation

Fix

Fixes as a diff

38 checks against the docs. Nothing is written until you say so: /tokendoctor:optimize.

[warn] compact-window-unset: No auto-compact window is set  code.claude.com/docs/en/model-config.md$ tokendoctor-apply compact-window-unsetWould change (user): ~/.claude/settings.json- {}+ {+   "autoCompactWindow": 400000+ }Dry run. Re-run with --write to apply.

Slide

Slide, don’t summarize

Old tool outputs go, the conversation stays word for word. No pause: /tokendoctor slide on. On a day of work in the benchmark, the same work cost 19% less and took 33% less time, every test passing.

One session, the same size:03:36  Claude Code’s summary   367K → 35K   65.3 s17:42  tokendoctor’s slide     368K → 36K   0.04 sSlide vs. summary, a day of work in bench/:< 1 sper compactiona summary takes 79 s−19%costsame work, all tests pass−33%timeno summary to wait for

Keep

Keep the cache through a break

Back after the cache’s hour, the next message writes the whole conversation into it again, at twice the input price. A one-word fork six minutes before the hour runs out keeps it warm, and never goes to a cache that may be cold: /tokendoctor keepalive on.

$ tokendoctor-sessions --days 30[info] keepalive-would-save  Keeping the prompt cache warm through pauses would have saved 1.7% here  Of 23 pauses longer than 54 minutes, 9 would have come back to a warm cache:  $26.21 of cache rewrites saved for $5.51 of pings (81).  In 12 the pings ran out first, and in 2 you came back within the hour.

Undo

Undo anything

Every setting by name, every change reversible. Costs no tokens: /tokendoctor undo.

> /tokendoctortokendoctor: settings  window      400K      tokens in context before auto-compaction  slide       on        elide old tool outputs instead of summarizing  effort      medium    reasoning effort  subagents   sonnet    model for subagents without their own> /tokendoctor undo   1  01 Nov at 04:35  user   slide: off → on   2  01 Nov at 04:35  user   slide: on → off

Proof

Six weeks of real use

One developer’s transcripts. On 25 October: a 400K window, Sonnet for subagents. Main-thread cost per request −38% at API list prices, the month before against the week after; context per request −47%, 412K → 219K tokens; the same sessions replayed −33%, only the window changed.

Mean context per request by day: 412K tokens in the month before, 219K after 25 October, when the compaction window went to 400K: 47% less

Yours

No one pill

Rarely past 400K tokens? The window won’t help. A summary just before you finish can cost more. Models, effort and the work itself move the number. On a Team or Enterprise login, the slide needs one sudo install. So tokendoctor shows you your own number before it changes anything.

Documentation

10 pages →

Releases

Full changelog →
  1. v0.8.0

    22 changes

  2. v0.7.0

    4 changes

  3. v0.6.1

    6 changes

  4. v0.6.0

    8 changes

  5. v0.5.1

    6 changes

See your own number first

Free · MIT license

  1. Add the marketplace

    claude plugin marketplace add localixai/plugins in a terminal.

  2. Install the plugin

    claude plugin install tokendoctor@localix-lab, then restart Claude Code.

  3. Measure

    /tokendoctor:sessions replays your own sessions at smaller windows, before anything changes.