← Today's AI open source

Today's AI open source · 2026-11-26

microsoft/TokenEconomizer

TokenEconomizer is a plugin that reduces the running cost of coding agents based on experience from previous sessions.

AgentsCoding tools

Repositorygithub.com/microsoft/TokenEconomizer ↗
Main languagePython
LicenseMIT
GitHub stars · forks★ 8,113 · 575 forks (as of 2026-11-26)
Created · last update2026-10-13 · 2026-11-25
GitHub topicsagentic-ai, agentic-coding, ai-coding, ai-coding-assistant, anthropic, artificial-intelligence, claude-code, codex

Overview

TokenEconomizer is a cost-reduction plugin for coding agents released by Microsoft Research, UC Berkeley and others. It does not change the agent itself; instead, it learns from sessions already run in the same repository to reduce waste in the next session. It supports Claude Code, Codex, GitHub Copilot CLI and Pi, with experimental support for opencode, Cursor Agent and others.

It works in three ways. Micro-skills remembers repository facts that would otherwise be rediscovered every session, such as the command for running tests or required environment variables, and provides them at session start. Tool pruning removes tools that have gone unused for a long time from the next session's configuration. The loop guard (Failure-loop intervention) checks with a judge model whether the agent is stuck when the same failure repeats, then inserts a short note into the context telling it to try a different approach.

It suits developers and teams who frequently run coding agents in the same repository and find token costs a burden. Each method can be turned on or off separately, and thresholds can be adjusted in the settings.

Why it is worth a look

It is a black-box approach that reduces cost using only accumulated session experience, without changing the model or agent, so it can be attached as-is to agents already in use. Notably, it breaks down the specific points where agent costs leak — relearning repository knowledge, sending definitions of unused tools, and failure loops — and addresses each one. Because it is a research output released alongside a paper, the reasoning behind its design can be traced.

Key features

What it is used for

Getting started

  1. Prepare a Python 3.10 or later environment.
  2. Follow the installation instructions in the repository README to install the plugin for the agent you use (Claude Code, Codex, GitHub Copilot CLI, Pi, etc.).
  3. Check the Settings section of the README and decide which features to use — Micro-skills, tool pruning, loop guard — and their thresholds.
  4. Run sessions in the same repository as usual and check the actions the plugin reports.

What to weigh

Related terms and companies

Sources

Written with AI assistance from the repository README and GitHub data. Star counts and other numbers are GitHub values as of the date shown; features and licensing can change, so check the repository.