Launch offer: the first 1,000 users get Settl free for a year* Claim your spot
settlbuilding in public

Cut your Claude Code bill: TokenEconomizer in one page

The short version

TokenEconomizer is a free, open-source (Apache 2.0) plugin from Microsoft Research, Microsoft Security and UC Berkeley. It changes what your coding agent re-reads on every turn, and it leaves the model and the agent alone. In the authors' own SWE-Bench tests it cut mean cost by 18.4-30.9% across five agent-model combinations. It was cheaper in all 30 repository x combination cells and raised Pass@1 in 4 of the 5 combinations.

Why it works: every turn pays again for the agent's instructions, every loaded tool and the conversation so far. Most tokens in a session are cached re-reads, not new thinking.

Mechanism What it does Default
Tool pruning Leaves out tools your sessions never use. In their profiling, 16 of the 23 tool descriptions billed every turn were never called. One command brings them back. On
Loop guard When a turn keeps hitting the same failures, a judge checks if it is stuck. At 70% or more, the agent gets one short note to try another approach. It never stops a turn itself. On
Micro-skills Learns facts about your repo (the test command that works here, a build step that must run first). It uses a fact only after three sessions confirm it. Off

Copy these prompts

1. Install on Claude Code (the three commands)

git clone https://github.com/microsoft/TokenEconomizer.git
claude plugin marketplace add "$PWD/TokenEconomizer"
claude plugin install tokeneconomizer@tokeneconomizer

Then start claude, trust the folder, and run /tokeneconomizer:status. Run /tokeneconomizer:toolprune refresh-catalog once per machine and after Claude Code updates. Keep the clone where it is: the plugin runs from it. You need Python 3.10+ on your PATH. Tested Claude Code versions: 2.1.300 to 2.1.310.

2. Turn on micro-skills (off by default)

/tokeneconomizer:config set microskills=on

Add --global for every repository. microskills=envfacts learns only from repeated failures, with no extra model calls.

3. Check what it did

/tokeneconomizer:status
/tokeneconomizer:toolprune
/tokeneconomizer:toolprune restore

status shows what it learned and what your sessions cost. toolprune lists the tools it left out and why. restore gives them back, and they are not removed again. TE_DISABLE=1 claude turns the whole plugin off for one session.

Know before you run it

Point Detail
Whose numbers The authors' own, on SWE-Bench and Web-Bench tasks. Your repo will differ; savings build up over sessions in the same repository.
Claude Code + Opus 4.8 30.9% cheaper, Pass@1 down 1.0 point
Claude Code + Sonnet 5 23.6% cheaper, Pass@1 up 1.3 points
Your settings Tool pruning writes only its own entries to .claude/settings.local.json, and waits until your sessions here have been idle for an hour before it changes anything.
Its own calls The judge and the redirect run through your agent and are counted in the cost it reports.
Other agents Codex, the GitHub Copilot CLI and Pi too (commands in the README); Cursor Agent and opencode are experimental.

If you are building an agent

Run this on your codebase

Look at how my Claude Code sessions in this repo use tools and context.
1. List the tools and MCP servers loaded here, and mark the ones I haven't used in recent sessions.
2. Find the instructions in CLAUDE.md that are long, repeated or out of date, and suggest a shorter version.
3. Note any error I keep hitting more than twice in a session, and the fix that worked.
Don't change any files. Give me the list first.

Source: github.com/microsoft/TokenEconomizer (README), the project page tokeneconomizer.github.io and arXiv 2610.22732, checked 4 Nov 2026.

Get the next one in your inbox