← Back to Leaderboard
Tmicrosoft

microsoft/TokenEconomizer

A hook-based coding-agent plugin that cuts repeat work and tool overhead.

View on GitHub ↗
Engineering Health (Methodology)
A+ · 93/100
Maintenance Activity
● Updated 3d ago
Latest Release
v0.1.0
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption18/25
Release Cadence20/20
License Clarity20/20
CLI1 README badge views (30d)
Total Stars
★ 8,344
24h Growth
+12
7d Growth
+173
Forks
601

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

microsoft/TokenEconomizer Star History (2026-10-17 - 2026-12-04) DAILY STAR HISTORY (35-DAY D1 TELEMETRY) +8.3k in 48d · avg +174/day 8.8k 4.4k 0 2026-10-17: ★ 12026-10-24: ★ 2212026-10-31: ★ 3,2562026-11-03: ★ 4,6712026-11-06: ★ 4,8742026-11-09: ★ 5,5242026-11-12: ★ 5,9362026-11-15: ★ 6,7482026-11-18: ★ 7,6832026-11-21: ★ 7,9032026-11-24: ★ 8,0742026-11-27: ★ 8,1712026-11-30: ★ 8,2772026-12-04: ★ 8,344 ★ 8.3k 10-17 11-10 12-04

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

TokenEconomizer is an in-process integration from the user's perspective, but it does not modify the host agent's code or model. It uses host hooks and session traces to learn repository facts, measure tool use, and establish what a normal turn looks like. Learning is scoped to each agent–repository pair, while settings are shared across agents. Interventions use interfaces the host already understands: injected context for facts and redirects, and native configuration for tool pruning.

The mechanisms, trace reader, ledger, and plugin runtime live in a Python package with no third-party runtime dependencies. The bundled plugin/scripts/te launcher does not require a separate package install. Pi has a TypeScript extension under plugin/pi/ and declares @earendil-works/pi-coding-agent in package.json. Despite working with MCP tools on some hosts, TokenEconomizer is a host plugin, not a standalone MCP server.

Key Capabilities & Differentiators

Micro-skills combine recurring failures with periodic model proposals. A fact enters the session-start context only after three sessions confirm it and is dropped if later evidence contradicts it. Tool pruning uses inactivity thresholds, but its precision depends on the host: individual tools in Claude Code, capability packages in Codex, and whole MCP servers in Copilot CLI. Pi has no pruning. The loop guard builds a baseline from successful turns, then evaluates suspected loops. It can bypass the judge when a turn repeatedly churns through the same edits and failures beyond 2.5 times its typical length. It redirects rather than interrupting execution.

Across 277 SWE-Bench tasks from six repositories, five agent–model combinations recorded 18.4–30.9% lower mean cost, and Pass@1 improved in four of five. Costs include cached-token pricing and the plugin's own model calls. Tasks were run in order within each repository starting with no learned state, so the aggregate result includes a cold start but is not a prediction for an isolated session.

Trade-offs & Limitations

Compared with hand-written repository instructions and a fixed tool allowlist, TokenEconomizer reduces manual upkeep by learning from what actually happens in sessions. The cost is a warm-up period and less predictable tool availability: pruning a whole MCP server can hide a rarely used but important tool along with the unused ones. Micro-skills are off by default because their proposer adds model calls, and the value of those calls depends on how often work repeats.

Pruning changes only plugin-managed entries, preserves existing deny rules, and can be reversed with toolprune restore. When a target file cannot be edited safely—for example, a tracked .codex/config.toml or invalid JSON—the plugin leaves a proposal instead of writing it. Measure billed cost and task completion together during a pilot. Use the terminal CLI for routine inspection when possible, since invoking the equivalent command inside the agent costs a model turn.

Hardware & Deployment Guide

Put Python 3.10+ on PATH and sign into a supported host. The standard plugin needs neither its own API key nor a GPU stack. Claude Code, Codex, and Copilot CLI install through a marketplace backed by a local clone, which must stay in place; Pi uses pi install git:github.com/microsoft/TokenEconomizer. Review host permissions during setup. Codex hooks take effect in the next session after approval, and Claude Code and Copilot CLI require a tool catalog refresh on initial setup and after host updates.

The first release, v0.1.0, covers Claude Code 2.1.300–2.1.329, Codex 0.153.1–0.171.0, Copilot CLI 1.0.83–1.0.114, and Pi 1.2.0–1.5.2, with a separate load-by-path route for Pi 0.99.x. Only the endpoints of the listed ranges were tested; newer versions are untested. Treat experimental hosts as separate rollout targets: for example, Cursor's tested headless configuration did not provide session usage, and its interactive TUI remains untested.

Runtime: The Python 3.10+ core has no third-party dependencies and ships a launcher at plugin/scripts/te; the Pi integration declares @earendil-works/pi-coding-agent.
Micro-skills: Off by default; when enabled, the model proposer runs every three sessions by default, and a fact is injected only after confirmation in three sessions.
Pruning evidence: A tool qualifies after 10 unused prompts across at least two sessions, or five sessions of any length; deny-list writes wait for 60 minutes of repository inactivity by default.
Host granularity: Claude Code prunes individual tools, Codex prunes capability packages, and Copilot CLI prunes entire MCP servers; Pi does not prune.
Loop policy: After five successful baseline turns, the default judge threshold is 0.7 with at most one redirect per turn; a 2.5× backstop covers prolonged repeated failures.
Cost accounting: On 277 SWE-Bench tasks, mean cost was 18.4–30.9% lower across five agent–model combinations, with cache pricing and plugin model calls included.
Best For

Teams that repeatedly use a supported coding agent in the same repositories and can compare billed cost, tool availability, and task success during a pilot.

Skip If

Work mostly happens in one-off repositories, every tool must remain available, or policy rules out the extra model calls needed for the features you want.

Reviewed on 2026-12-03 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

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

Comparison vs. Top Coding, Skills & MCP Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
TokenEconomizer ★8.3k+173PythonMITA hook-based coding-agent plugin that cuts repeat work and tool overhead.
rtk88.7k+684RustApache-2.0A local Rust CLI wrapper that trims command output before coding agents read it.
ECC316.1k+4.2kJavaScriptMITPlugins and CLI workflows for planning, reviewing, and verifying agent-written c
caveman124.8k+1.4kGoApache-2.0Coding-agent skill and local Go proxy for shorter replies and smaller tool outpu

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/microsoft/TokenEconomizer.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

microsoft/TokenEconomizer Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about TokenEconomizer

Does TokenEconomizer run as a separate MCP server?

Install it into a supported coding agent. Host hooks and transcripts supply session evidence, session-start context carries learned facts, and the host's native settings control tool pruning. Use status to see what the plugin learned or changed and config to inspect the effective settings.

What hardware and runtime overhead should I budget for?

The standard Python runtime requires Python 3.10 or newer and uses only the standard library. It does not require CUDA or a dedicated GPU. Model overhead comes from the loop guard's judge and redirect calls and, if enabled, the micro-skills proposer. macOS 27 offers an optional on-device judge via local_model=fm; this does not make every model call local.

Can we use it commercially and keep the deployment local?

The MIT license permits commercial use and local installation. Retain the copyright and license notice when redistributing the software. The plugin does not handle credentials or need an API key of its own, but a local install does not make the host agent or plugin model calls offline. Review what those calls read and whether your host's data handling meets your requirements.

When is it better than repository instructions and a manually curated tool list?

Use static repository instructions and manual tool settings when the rules are stable, the tool set is small, or every session must start with the same capabilities. TokenEconomizer is more useful when repeated sessions uncover the same problems or carry tool definitions they rarely use. Pilot it on one repository and compare billed cost and task success before rolling it out.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining microsoft/TokenEconomizer? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature microsoft/TokenEconomizer on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare