
Added Nov 15, 2026
TokenEconomizer
A plugin for coding agents such as Claude Code and Codex that learns from past sessions in your repo to cut agent running costs.
- Ecosystem
- Agent Skills
- Skill category
- Coding
- Creator / organization
- Aaron J. Li 等(GitHub microsoft)
What it is
TokenEconomizer comes from researchers at UC Berkeley, Microsoft Research and Microsoft Security, and the repository sits under the microsoft organization. It is a plugin for coding agents that makes them cheaper to run in the repositories you work in often, without changing the agent itself. Claude Code, Codex, the GitHub Copilot CLI and Pi are supported, with experimental support for opencode, Cursor Agent, Grok Build, Hermes Agent, the Antigravity CLI and Factory Droid. AI's role: one model reviews recent sessions and proposes facts about the repo, and a judge model checks whether the agent is stuck. These model calls run through your own agent login.
Highlights:
- Remembers common facts about your repo (micro-skills) so the agent explores less.
- Removes tools that have gone unused for a long time from later sessions (tool pruning).
- Detects stuck turns and nudges the agent to try another approach (failure-loop intervention).
- The page reports lower average cost on SWE-Bench tasks and links a paper.
How to use:
- First, check that your agent is on the supported list and that Python 3.10 or newer is installed.
- Then install it with the commands in the README for your agent, for example pi install git:github.com/microsoft/TokenEconomizer for Pi.
- Finally, keep using your agent in your usual repositories and the plugin learns in the background.
Who it's for:
Developers who often use coding agents like Claude Code or Codex in the same few repositories and want to keep costs down.
Before you start:
- You need Python 3.10 or newer and one of the listed coding agents.
- The plugin needs no API key of its own and never handles credentials. Model calls go through your own agent, and the cost counts toward your agent account.
- What it learns is stored on your machine in ~/.tokeneconomizer.
- It edits the agent's settings files (for example .claude/settings.local.json, .codex/config.toml, .github/copilot/settings.local.json) to remove tools, and adds newly created settings files to .git/info/exclude.
- On Claude Code it can optionally read past session logs, which is off by default.
- Some experimental support has platform limits: Cursor Agent and the Antigravity CLI work only on macOS and Linux.
- License: Apache-2.0.
Based on the project's public documentation. Not tested by AI Inspiration World.