Skip to content
Back to search

tokendoctor

MarketplaceWorks with Claude CodeGitHub

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.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked yesterday

Check it deeper on your machine

It has changed since its scan on 18 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/localixai/tokendoctor with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/localixai/tokendoctor'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/rsaryev--tokendoctor/badge.svg)](/listings/rsaryev--tokendoctor)

HTML

<a href="/listings/rsaryev--tokendoctor"><img src="/api/listings/rsaryev--tokendoctor/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

claude plugin marketplace add localixai/tokendoctor
claude plugin install tokendoctor@tokendoctor

Restart Claude Code and run `/tokendoctor:sessions` to see what your last 30 days would have cost at each window. Nothing changes until you pick it.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 14 lines
  1. {
  2. "name": "tokendoctor",
  3. "owner": {
  4. "name": "rsaryev"
  5. },
  6. "description": "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.",
  7. "plugins": [
  8. {
  9. "name": "tokendoctor",
  10. "source": "./",
  11. "description": "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."
  12. }
  13. ]
  14. }
README.md · README · 125 lines
  1. <p align="center">
  2. <picture>
  3. <source media="(prefers-color-scheme: dark)" srcset="docs/logo.svg">
  4. <img src="docs/logo-light.svg" width="72" height="72" alt="tokendoctor">
  5. </picture>
  6. </p>
  7. <h1 align="center">tokendoctor</h1>
  8. <p align="center">
  9. <strong>The same Claude Code for up to 38% less</strong>
  10. <br>
  11. Replays your own past sessions to show what each change would have saved, then changes only what you pick.
  12. </p>
  13. <p align="center">
  14. <a href="https://github.com/localixai/tokendoctor/actions/workflows/ci.yml"><img src="https://github.com/localixai/tokendoctor/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
  15. <a href="CHANGELOG.md"><img src="https://img.shields.io/github/v/tag/localixai/tokendoctor?label=version" alt="Version"></a>
  16. <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
  17. </p>
  18. <p align="center">
  19. <a href="#install">Install</a> &bull;
  20. <a href="https://tokendoctor.localix.ai/docs">Docs</a> &bull;
  21. <a href="https://tokendoctor.localix.ai">Website</a> &bull;
  22. <a href="CHANGELOG.md">Changelog</a>
  23. </p>
  24. <p align="center">
  25. <img src="docs/demo.gif" alt="tokendoctor in a real Claude Code session: /tokendoctor:sessions, then the daily trend" width="880">
  26. </p>
  27. **Your past sessions decide, not anyone's benchmark.** What a setting saves depends on how you
  28. work: how long your sessions run, which models you use, what the work is. A number from someone
  29. else's sessions, mine included, says little about yours. So tokendoctor starts by looking back at
  30. your own.
  31. **① Look back at your last 30 days.** `/tokendoctor:sessions` replays every session you had,
  32. request by request, at compaction windows of 200K, 300K, 400K and 600K, and shows what each would
  33. have cost. It only reads your transcripts, makes no model calls and changes nothing. The figure is
  34. an upper bound: a replay can't see work the model would have redone after a summary.
  35. **② Change only what your sessions show pays, and undo it.** `/tokendoctor:optimize` proposes
  36. changes from those numbers and checks your settings against Claude Code's docs; it applies only the
  37. ones you pick, each shown as a diff first. `/tokendoctor undo` puts any of them back.
  38. **③ Optional: slide instead of summarize.** When Claude Code would stop to summarize the
  39. conversation, tokendoctor drops old tool output instead and keeps every message. There is no model
  40. call, so it takes milliseconds, not a minute.
  41. ## Install
  42. ```bash
  43. claude plugin marketplace add localixai/tokendoctor
  44. claude plugin install tokendoctor@tokendoctor
  45. ```
  46. Restart Claude Code and run `/tokendoctor:sessions` to see what your last 30 days would have cost
  47. at each window. Nothing changes until you pick it.
  48. ## What it found in mine
  49. Every request sends the whole conversation to the model. On models with a 1M window, Claude Code
  50. compacts only near 967K tokens, so the end of a long session is the expensive part. For me, two
  51. thirds of main-thread cost went to requests with more than 400K in context.
  52. So I set a 400K window and Sonnet for subagents. Comparing the month before with the week after,
  53. about 23K and 19K main-thread requests, context per request went from 412K to 219K and cost per
  54. request fell 38% at API list prices. That's one person's before and after, not a controlled
  55. experiment.
  56. The catch is more summaries, and each is a pause: 79 seconds on average in my sessions. That's
  57. what the slide is for. Your sessions may show something else entirely, which is the point of
  58. looking at them first.
  59. ## What the benchmark shows
  60. On the [benchmark](bench/README.md), Claude Code builds a TypeScript project against tests it
  61. can't change, so a run counts only if the tests pass. Cost is per task, on Haiku 5.5:
  62. | Compared | Cost | Time |
  63. | --- | --- | --- |
  64. | Slide against a summary, a day of work | −19% | −33% |
  65. | Slide against a summary, an eval harness | −35% | −28% |
  66. | Slide against a summary, a short task | +6% | −17% |
  67. | The settings advice alone, against Claude Code as it ships | dearer in 3 of 4 runs | |
  68. | The advice and the slide, a week of work | −11% to −21% | |
  69. Every test passed in every run. The advice alone didn't pay here because these tasks rarely pass
  70. 400K, which is where the window starts to matter. If your sessions don't either, your replay will
  71. show it, and you should leave your window alone. Every run, the losing ones too, is in
  72. [bench/HISTORY.md](bench/HISTORY.md).
  73. <p align="center">
  74. <img src="docs/dashboard.png" alt="The author's tokendoctor dashboard: 57% of the spend was Claude re-reading the conversation" width="880"><br>
  75. <sub><code>/tokendoctor:dashboard</code>: where every token went, by day, model, subagent and project. One local file; this one is mine.</sub>
  76. </p>
  77. ## Commands
  78. | Command | What it does |
  79. | --- | --- |
  80. | `/tokendoctor:sessions [days]` | Replays your past sessions (30 days, or `days`) at smaller windows: what each would have saved, then where your tokens went. Reads only. |
  81. | `/tokendoctor:audit` | Your settings, memory and CLAUDE.md checked against the docs, by severity. Reads only. |
  82. | `/tokendoctor:dashboard [days]` | Opens a local dashboard of every session on this machine. |
  83. | `/tokendoctor:optimize [focus]` | Proposes up to five changes from your numbers and applies the ones you pick. |
  84. | `/tokendoctor [name] [value]` | Shows, explains or changes a setting, with no model call. |
  85. | `/tokendoctor undo [n]` | Lists every change tokendoctor made and puts one back. |
  86. Nothing leaves your machine: the only network call is to two public pages of Claude Code's docs,
  87. once a day. It never switches your models on its own.
  88. ## Documentation
  89. **[tokendoctor.localix.ai/docs](https://tokendoctor.localix.ai/docs)** has the rest: the
  90. [38 checks](https://tokendoctor.localix.ai/docs/audit), every
  91. [setting](https://tokendoctor.localix.ai/docs/settings),
  92. [how the slide works](https://tokendoctor.localix.ai/docs/slide) (and Team and Enterprise
  93. logins), the commands from a shell, the [measurements](https://tokendoctor.localix.ai/docs/proof)
  94. and the [limits](https://tokendoctor.localix.ai/docs/limits). To work on tokendoctor itself, see
  95. [CONTRIBUTING.md](CONTRIBUTING.md).
  96. ## License
  97. MIT
site/src/pages/kit/samples.ts · Bundled script · 93 lines · 1 finding marked
  1. import type { Block, Card } from '@/shared/config';
  2. /** The kit's specimens. They are the template's, not a site's content: a site's copy never
  3. * changes what the kit shows, only its theme does. */
  4. export const ONE_WAY: [string, string][] = [['npm', 'npm create example@latest']];
  5. export const THREE_WAYS: [string, string][] = [
  6. ['curl', 'curl -fsSL https://example.com/install | sh'],
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 7 on GitHub
  7. ['brew', 'brew install example'],
  8. ['npm', 'npm install -g example'],
  9. ];
  10. export const BLOCKS: { name: string; text: string; blocks: Block[] }[] = [
  11. {
  12. name: 'shell',
  13. text: 'A session: lines that start with `$` are commands and are highlighted, the rest is output.',
  14. blocks: [{ lang: 'shell', text: '$ example build --target web "src/**/*.ts" > build.log\n$ echo $?\n0' }],
  15. },
  16. {
  17. name: 'json',
  18. text: 'Data, highlighted.',
  19. blocks: [{ lang: 'json', text: '{\n "status": "done",\n "files": 12,\n "cached": true\n}' }],
  20. },
  21. {
  22. name: 'grid',
  23. text: 'A table in real columns, aligned per column (`align: "rll"`), each cell with a tone of its own.',
  24. blocks: [
  25. {
  26. grid: [
  27. [['dim', '0'], ['ok', 'done'], ['dim', 'everything passed']],
  28. [['dim', '1'], ['bad', 'failed'], ['dim', 'a check did not pass']],
  29. [['dim', '130'], 'interrupted', ['dim', 'stopped by a signal']],
  30. ],
  31. align: 'rll',
  32. },
  33. ],
  34. },
  35. {
  36. name: 'ui and out',
  37. text: 'A drawn screen, part by part, and single lines of output. The tones: plain, `dim`, `hi`, `ok`, `bad`, `acc`, `sel`.',
  38. blocks: [
  39. { ui: [[['sel', '❯ '], ['hi', 'Deploy to production'], ['dim', ' enter']], [['', ' '], ['', 'Deploy a preview']], [['', ' '], ['dim', 'Cancel']]] },
  40. { out: '3 checks passed', tone: 'ok' },
  41. { out: '1 warning: the bundle grew by 4 kB', tone: 'acc' },
  42. { out: 'took 1.8 s', tone: 'dim' },
  43. ],
  44. },
  45. ];
  46. export const CARD: Card = {
  47. tag: 'For whom',
  48. title: 'A card says one thing',
  49. text: 'Words on the left, what shows them on the right: a drawn terminal, a picture, a clip or a recording. Code in the text is marked with backticks, like `--flag`.',
  50. links: [{ label: 'A link to more', href: '#card' }],
  51. media: { kind: 'terminal', blocks: [{ lang: 'shell', text: '$ example check\n' }, { out: 'ok 12 files, 0 problems', tone: 'ok' }] },
  52. };
  53. /** The usage statistics card's words on a site that has not set its own. */
  54. export const CONSENT = {
  55. notice: 'We count visits with Google Analytics, only with your yes, to see which pages help.',
  56. privacy: '#consent',
  57. };
  58. export const PROSE = `## A second-level heading
  59. A paragraph of a docs page, with **strong words**, a [link](#prose), and \`inline code\` such as
  60. \`--dry-run\`. It keeps to a measure a line is easy to follow in.
  61. ### A third-level heading
  62. - A list item.
  63. - Another, with \`code\`.
  64. 1. A numbered step.
  65. 2. The next one.
  66. \`\`\`sh
  67. # a code block, with its language and a Copy
  68. npm run build -- --mode production
  69. \`\`\`
  70. \`\`\`ts title="content/site.ts"
  71. // any common language is highlighted at build time
  72. const site: SiteConfig = { name: 'sitekit', url: 'https://example.com' };
  73. \`\`\`
  74. > [!NOTE]
  75. > A callout, written as GitHub writes it.
  76. | Option | Default | What it does |
  77. | --- | --- | --- |
  78. | \`--port\` | \`5173\` | Where the dev server listens. |
  79. | \`--open\` | off | Opens the browser once it is up. |
  80. `;

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.