Fortytude/TokenDiet
11 stars · Last commit 2026-07-08
README preview
<div align="center"> # TokenDiet ### Your code is overpaying for AI. `/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. [](./LICENSE) [](https://docs.claude.com/en/docs/claude-code/plugins) [](https://fortytude.dev) </div> --- 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.