
Tokenade
Cut your AI agent's token bill
About Tokenade
Tokenade is a local command-line tool that cuts the number of tokens AI coding agents send to their model. Its premise is that most of an agent's bill is not the code it writes but what it reads: at every step the agent re-sends the whole conversation so far, so a 600-line build log, a whole file or a verbose MCP result is paid for again on every following step. Tokenade sits between the agent and its tools and trims that material before the model sees it, compacting command output, file reads, documents, web searches and MCP results, while keeping the complete original in a local stash so nothing is lost. One install command wires it into the coding agents on a machine, including Claude Code, Codex, Cursor, GitHub Copilot CLI, OpenCode, Kilo Code and Cline, through each agent's own hooks, plugins or MCP configuration, so you keep working exactly as before.
Tokenade is built by Paul Irolla, an independent developer in France, and published on GitHub as pi-infected/tokenade, written in Rust and licensed under MIT or Apache 2.0 at your choice. The software is free and nothing is sold through its site; the accounts and paid plans it offered earlier were closed in October 2026. Compaction runs on your own computer and the software sends no telemetry. Its only automatic outbound requests are a daily update check against GitHub Releases, public model price lists from LiteLLM and Helicone used for dollar estimates, and a one-time download of an embedding model from Hugging Face the first time you use semantic search. The author also publishes THOL, a benchmark comparing token optimizers on whole Claude Code sessions, and the site states plainly that it is maintained by Tokenade's author and is reproducible rather than independent.
Installation takes two commands: npm install -g @tokenade/cli, which places a prebuilt native binary for Linux, macOS or Windows on your machine (Node.js 18 is needed only for the installer), then tokenade install, run as your normal user. A --dry-run flag prints every file it would change without writing anything. The install step detects the agents on the machine and adds hooks or a plugin to each, writes a short Tokenade rules section into each agent's global rules file such as ~/.claude/CLAUDE.md or ~/.codex/AGENTS.md, routes third-party MCP servers through tokenade mcp-wrap, and sets up a local LLM proxy on 127.0.0.1 only where an agent's hooks cannot do the job. Existing hooks, MCP servers and rules are merged rather than replaced.
During a session, a hook runs before each tool call and can rewrite a shell command to go through tokenade wrap, and another runs after it to replace the result with a compact version. Output passes through redaction, a compactor, then a fold: anything still above about 5,000 tokens is stashed whole on disk and replaced by a preview with a 12-character hash the agent can expand. If the compacted version would be larger than the original, the raw output is returned instead. Hooks always exit cleanly, so a Tokenade failure never blocks the agent. tokenade dashboard opens a local report of the tokens saved per feature.
- •
Command-Aware Compaction - Tokenade recognises the command that ran, with compactors for git, cargo, npm, pytest, kubectl, docker, terraform and many more, and otherwise recognises the output format, such as JSON, YAML, CSV, logs, diffs, stack traces and tables. Source files you are likely to edit pass through unchanged, and you can add your own compactors and filters in TOML.
- •
Lossless Stash and Recovery - Folded output is never thrown away. The agent gets a preview and a hash, and tokenade expand-ref brings back the complete text, answers several questions over it at once with --prompt, or returns exact matching lines with --grep.
- •
Code Intelligence Commands - map, skeleton, query, impact and semantic answer where code lives without loading whole files: a repository layout, signatures only, where a symbol is defined and who calls it, what breaks if a file changes, and plain-language search by meaning. All five read a local index that is built on first use and refreshed automatically.
- •
Smarter File, Document and Web Handling - A re-read of an unchanged file gets a short pointer instead of the full content. PDF, Office and EPUB files are turned into text, media files are described rather than returned as bytes, large images are downscaled, and web searches run locally across several engines.
- •
MCP Wrapping and LLM Proxy - Third-party MCP servers run behind tokenade mcp-wrap, with dedicated handling for GitHub, Playwright, Postgres and other popular servers. Where hooks cannot reach, the local LLM proxy folds tool results already in the conversation history, removes exact duplicates and scrubs credentials.
- •
Secret Redaction and Dead-End Memory - Credentials Tokenade recognises are replaced before anything is stored or shown, which the site describes as best-effort protection. tokenade mistake keeps a short list of approaches that did not work, and the three newest are shown to the agent at the start of each session.
Tokenade is for developers who run AI coding agents such as Claude Code, Codex, Cursor or GitHub Copilot on long, multi-step work and keep hitting usage limits or paying for tokens they never needed to send. The site is explicit that the biggest effect comes on long sessions, where re-sent history dominates the bill, and that a quick one-off question has little to remove. Developers who run several agents on one machine benefit from a single install that wires each of them, and those who rely on many MCP servers get their large results folded without changing the servers.
It also suits teams with strict data boundaries, because compaction happens locally, the software sends no usage data to its author, and the source is open to audit. Engineers who want to see the effect can check the local dashboard and per-session receipts rather than trusting a headline number. It is less useful for chat-only workflows: Claude Desktop's chat mode gets MCP optimisation only, Claude Cowork is not supported, and agents with no hook or plugin surface rely on the proxy or on manual commands. Anyone evaluating it should note that the public repository and the free model are both new as of October 2026.















