TokenEconomizer, developed by UC Berkeley and Microsoft Research, is a plugin for Claude Code, Codex, Copilot CLI, and Pi (with experimental support for tools like opencode and Cursor Agent). It employs three mechanisms: it summarizes repository common sense from recurring failures and periodic reviews, informing the agent at the start of new sessions after confirmation across three sessions; it stops loading tools that have not been used for a long time; and when repeated failures occur within the same turn, a judge model determines if the process is stuck, prompting a change in approach at most once without aborting the task. The paper reports an average cost reduction of 18.4% to 30.9% across five agent-model combinations on 277 SWE-Bench tasks from 6 repositories, with improved Pass@1 scores for 4 combinations.
Why it matters It saves costs by leveraging experience accumulated repeatedly within the same repository, without changing the model or agent code; the savings are calculated based on actual billing metrics, including the plugin's own model calls.
Stars 6510 (+29 / 24h)
Reasons
- 29 new stars in 24 hours, totaling 6510 stars (indicating attention only); Apache-2.0 license
- The README includes paper authors, experimental setups, and reproducible experiment directories, with thresholds for each mechanism written as adjustable settings
Usage
- After cloning the repository, run
claude plugin marketplace add <local_path>in Claude Code, thenclaude plugin install tokeneconomizer@tokeneconomizer. Enter the project and run/tokeneconomizer:status; Codex and Copilot CLI have corresponding commands
Risks
- Codex requires trusting all hooks to function; the plugin runs from the cloned directory, so the clone cannot be deleted
- The cost reduction figures come from measurements on benchmark tasks in the paper; effectiveness in daily repositories depends on how frequently the tool is used within the same repository