How token-diet cuts coding agent output without touching the code
Always-on token-efficiency skill for coding agents (Claude Code, Codex, Cursor, Windsurf, Cline). ~31% lower bill on average, no loss of correctness.
At a glance
- What is it?
- Kulaxyz/token-diet is a set of output rules for Claude Code, Codex, Cursor, Windsurf and Cline that the installer writes into a channel the agent loads every session. The project's own benchmark puts the average bill reduction at 31 percent, and how much of that you see depends on what your sessions spend tokens on.
- Who is it for?
- Adopt token-diet if your agent sessions are dominated by generated prose: planning documents, review write-ups, long explanations, test scaffolding. Skip it if your spend is mostly file reads, where the published bill reduction is 17 percent.
- Can I use it commercially?
- Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
- Is it still maintained?
- Yes. The repository last received commits 76 days ago.
- What is it written in?
- Mainly Shell, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 18, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What token-diet changes inside a session
token-diet is a skill, meaning a body of instructions, not a program that sits between you and the model. It covers the parts of a session that generate text: chat replies, documentation, memory files, hand-offs, plans, code comments, tests, the code itself, the way context is read, and the way tools are called.
The reply rules are the plainest: lead with the answer, drop the opening filler and the closing offer to help, and report deltas instead of narrating the work. For tests the rule is narrower than most engineers would write themselves: cover the key paths plus critical and edge cases, group them, keep to at most ten per session, and never skip the money, auth or data-loss paths. Code follows YAGNI, stays idiomatic, and carries no dead code.
The context rules are the ones that change agent behaviour most. Grep before reading, read only the lines you need rather than whole files, batch reads, use fewer turns, and never re-read a file that was just edited. Tool calls should be batched when independent, and the agent is told to stop as soon as it has enough to act. Broad but bounded search can go to a cheaper sub-agent model while correctness-sensitive verification stays with the main model.
One guardrail runs through all of it: concision applies to output, never to reasoning. Correctness, critical test coverage, and verbatim code, commands and error text are declared off-limits.
How the always-on injection works
A skill body normally loads on demand, which means a user has to ask for it each time. token-diet wants the opposite, so the installer writes the directive into a channel that fires on every session: a SessionStart hook for Claude Code, or an always-loaded context file elsewhere, which the README names as AGENTS.md for Codex and rule files for Cursor, Windsurf and Cline. The README points at the caveman project as using the same trick.
The practical consequence is that there is no per-message command to remember. If you do want to change behaviour mid-session, /token-diet accepts on, lite, ultra and off.
Installing token-diet and picking a level
The installer auto-detects which of the supported agents is present and writes into the matching channel. This one-liner fetches install.sh from the repository and runs it:
curl -fsSL https://raw.githubusercontent.com/Kulaxyz/token-diet/main/install.sh | bashOptions pass through with bash -s --, so this installs the telegraphic level instead of the default:
curl -fsSL https://raw.githubusercontent.com/Kulaxyz/token-diet/main/install.sh | bash -s -- --ultraYou can also clone the repository and run the script directly, which is where the per-agent and per-project flags are easiest to read:
./install.sh -a codex --projectHere -a codex limits the install to Codex instead of every agent found, and --project writes into the current repository rather than the global location. After the installer finishes, the next session should open with answers instead of preamble, and shorter hand-off documents. If you want it gone, ./install.sh --uninstall removes it.
The four levels and what each one gives up
on is the default and applies everything listed in the README. lite keeps the communication and artifact rules only, leaving code, tests and context handling alone. ultra makes chat and progress telegraphic while code, tests and docs stay precise. off turns it back to the agent's normal voice.
The README gives one measured example of what ultra does to a reply. A normal answer about a failing Stripe webhook signature runs 102 tokens, while the ultra version runs 34 tokens, a 66 percent reduction, counted with the o200k_base encoding. The README's point is that both answers name the same function, the same fix and the same file path, and only the filler is gone.
What the benchmark covers
The published table covers three session types run on Sonnet 5. Output-heavy work such as advice, planning and explanation shows 81 percent less output and a 54 percent lower bill. A code change with tests against nestjs/nest, a repository of 1673 files, shows 49 percent less output and a 22 percent lower bill. Read-heavy comprehension shows 30 percent less output and a 17 percent lower bill. The stated average is 53 percent output reduction and 31 percent bill reduction.
Two caveats sit next to those numbers in the README itself. The average is unweighted across the three scenarios, and the 54 percent figure is described as best case rather than typical. Correctness reportedly held in every run. The method and full tables live in bench/RESULTS.md, and the project says you can reproduce the run with ANTHROPIC_API_KEY set and node bench/bench.mjs, the bench directory being part of the repository listing.
Where the savings run out
The read-heavy row is the honest boundary of this tool. When a session spends its budget reading files, output compression barely moves the bill, and the README puts that case at 17 percent. Teams whose agents spend the day comprehending a large codebase should expect the low end, not the headline number.
There is also a trade in the context rules. Reading fewer lines and stopping tool calls as soon as there is enough to act is a bet that the agent guessed right about where the answer lives. The guardrails instruct it not to trade correctness for brevity, but that is an instruction to a model, not a guarantee, and nothing in the repository measures how often a shorter read path misses something.
Finally, the install path is a remote script piped straight into bash. Anyone adopting this in a team setting should read install.sh first, which the repository does ship at the top level.
Writing the rule yourself instead
The injection channel is an ordinary file, so the alternative is to skip the project and write your own concision rules into AGENTS.md for Codex or a Cursor, Windsurf or Cline rule file. That is the same file the installer targets, and it costs nothing.
The difference is in what you get for the effort. Hand-written rules give you no levels to switch, no uninstall path, no measured baseline, and no maintenance when a new agent version changes how context files are loaded. token-diet ships the wording, the installer that finds the right channel, the four levels, and the bench.
Repository state and what is left open
The repository listing is small: README.md, SKILL.md, activation.md, activation-ultra.md, bench/ and install.sh. The last push was on 2026-07-04.
No license file appears in that listing and GitHub reports no license for the repository, so the terms under which the skill text can be reused or modified are not stated. Anyone placing it in a company repository should settle that with the author first.
Editorial conclusion
Adopt token-diet if your agent sessions are dominated by generated prose: planning documents, review write-ups, long explanations, test scaffolding. Skip it if your spend is mostly file reads, where the published bill reduction is 17 percent. Before trusting any of it, reproduce the project's own bench with node bench/bench.mjs against your own workload, because the 31 percent average comes from three specific scenarios that may not resemble yours.
Frequently asked questions
Does token-diet work with Codex?
Yes. The installer takes -a with claude, codex, cursor, windsurf, cline, all or print, and for Codex it writes the directive into AGENTS.md. Without -a it auto-detects which agents are installed.
How do I turn token-diet off during a session?
Send /token-diet off to the agent, which switches back to the default voice for that session. Running ./install.sh --uninstall removes the installed directive entirely.
Does the ultra level shorten the code too?
No. Under ultra, chat and progress text go telegraphic while code, tests and documentation stay precise. The guardrails keep correctness, critical test coverage and verbatim code, commands and errors off-limits to compression.
Can I install token-diet for a single repository?
Yes. Pass --project and the installer writes into the current repository instead of the global location, which is the right choice when only one project should change how its agent writes.
Community notes