Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By FortytudeMITIn 1 marketplace
Finds wasteful LLM API spend in your repo, such as missing prompt caching, uncapped retries and prompt bloat, and returns a file-level fix plan. Runs in your own agent and claims nothing leaves your machine; it gives no dollar estimates.
Trending plugins
7-day copy clicks
You run one by typing its /name in Claude Code.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
llm-cost, api-cost, prompt-caching, token-usage, cost-optimization, code-audit, llm, cost ·
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
/tokendiet finds where — free, in your editor, in about a minute.A Claude Code plugin that audits your own repo for wasteful LLM API spend — missing prompt caching, uncapped retries, prompt bloat, no batching, overpowered models — and hands you a concrete, honest fix plan. Runs on your agent, your tokens, your repo. Nothing leaves your machine.
Hosted LLM APIs bill per token. Most codebases quietly re-send the same system prompt uncached on every call, run offline batch jobs on the real-time API, never cap a retry loop, and pretty-print JSON into the prompt. None of it shows up in a code review — it shows up on the invoice.
/tokendiet reads your code the way a senior LLM-cost engineer would, finds those patterns at the exact file:line, explains the mechanism, and gives you the fix. It offers to apply the safe, behavior-preserving ones for you.
And it never invents a dollar figure. More on why that matters below — it's the whole point.
You type /tokendiet. Your agent walks your repo and prints something like this (illustrative — your findings and paths will differ):
## TokenDiet audit — whole repo
Reviewed 14 LLM call-sites across 6 files. Found 4 findings.
### Safe mechanical wins (behavior-preserving — ship these)
1. Missing prompt caching — src/agent/planner.py:57
WHAT: a ~2,100-token system prompt + tool schema is re-sent uncached on every
Anthropic call.
WHY: cached reads bill at ~10% of the input rate (Anthropic published) — right
now you pay full input price for the same bytes on every request.
FIX: add cache_control:{type:"ephemeral"} on the last stable system block.
CLASS: SAFE-MECHANICAL
2. Timestamp busting the cache — src/agent/planner.py:44
WHAT: `Current time: {datetime.now()}` sits at the FRONT of the system prompt.
WHY: caching is a prefix match; a value that changes every call invalidates
everything after it, so the hit rate is ~0 even once caching is on.
FIX: move the timestamp to the end of the prompt, after the static prefix.
CLASS: SAFE-MECHANICAL (this IS the cache win for this prefix — counted once)
### Suggestions to validate (behavior-change — your call)
3. Overpowered model for a classify task — src/route/intent.py:88
WHAT: `classify_intent()` calls a flagship model to pick one of 5 labels.
WHY: a small model is roughly ~5× cheaper on input and may handle a labeling
task fine — but a swap changes output quality.
FIX: try a cheaper same-family model and validate the labels on your own data.
CLASS: BEHAVIOR-CHANGE (a downgrade is a suggestion, never a promised saving)
### Guard-rails & notes (informational)
4. No max_tokens cap in the agent loop — src/agent/loop.py:15
WHAT: the completion call has no max_tokens / max output ceiling.
WHY: a runaway loop or a degenerate response can emit the full output window —
an unbounded bill. (A ceiling, not a saving — no dollar figure.)
FIX: add an explicit max_tokens sized to what the response needs.
CLASS: INFORMATIONAL
Want me to apply the 2 safe mechanical wins? I'll show the diff first.
— Audited by /tokendiet · TokenDiet by Fortytude (fortytude.dev). Free & open source.
That's the whole product. No signup, no dashboard, no dollar amount pulled out of thin air.
In Claude Code:
/plugin marketplace add Fortytude/TokenDiet
/plugin install tokendiet@tokendiet
Then run it:
/tokendiet
That's it. marketplace add points Claude Code at this repo; install pulls the tokendiet plugin from it. No API keys of ours, no account, no config.
Prefer the terminal? The same works non-interactively once the marketplace is added:
claude plugin marketplace add Fortytude/TokenDiet
claude plugin install tokendiet@tokendiet
The same audit ships for three more editors — same knowledge, native packaging. Each folder under editors/ has its own README:
| Editor | Get it | Run it |
|---|---|---|
| Cursor | copy editors/cursor/.cursor/ into your repo | /tokendiet in Agent chat |
| GitHub Copilot | copy editors/copilot/.github/ into your repo | /tokendiet in Copilot Chat |
| Codex | copy editors/codex/.agents/ + AGENTS.md into your repo | $tokendiet, or just ask "audit my LLM cost" |
/tokendiet takes an optional scope. Give it as much or as little as you want:
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub fortytude/tokendiet --plugin tokendietPlugins from other owners that cover similar ground