# microsoft/tokeneconomizer

> tokeneconomizer is a plugin for coding agents such as Claude Code and Codex that makes them cheaper to run in the repositories you work in often. It works without changing the agent itself, and it uses the sessions the agent has already run in a repository to cut waste in the sessions that follow. The project is written mainly in Python.

Source: https://github.com/microsoft/tokeneconomizer
Indexed: commit 12468f4 on 2026-11-18 by Repowise. Facts come from the source and git history, not from the maintainer.

## Facts

- Type: Command-line tool
- Language: Python
- Stars: 7,935 at index time
- License: MIT
- Code health: 6.6/10, Fair
- Last commit: 2026-11-17
- Contributors: 45

## Install

From the README: https://github.com/microsoft/tokeneconomizer#install

Claude Code:

Register the clone as a plugin marketplace in Claude Code.
    claude plugin marketplace add "$PWD/TokenEconomizer"

Install the tokeneconomizer plugin from that marketplace.
    claude plugin install tokeneconomizer@tokeneconomizer

## How it works

The entry points are tokeneconomizer/__init__.py and tokeneconomizer/plugin/cli.py. The tokeneconomizer package switches on the token-saving stages for an agent run and decides when an agent is stuck repeating a failing fix. The plugin folder holds the host integrations, and plugin/opencode/tokeneconomizer.ts is the TypeScript plugin for opencode. The scripts directory packages the plugin into folders that Claude Code and Factory Droid can install. The experiments directory runs the benchmark sweeps that measure how much the token-saving stages save on coding tasks.

- tokeneconomizer/__init__.py: entry point
- tokeneconomizer/plugin/cli.py: entry point
- .claude-plugin/marketplace.json: central file
- .github/workflows/dead-code-sweep.yml: central file
- .github/workflows/submission-limit.yml: central file
Modules: experiments, tokeneconomizer, tests, plugin, docs, scripts. 237 files, 43,733 lines, 3,815 symbols.

## Code health

- Score: 6.6/10 (Fair)
- Rank: #181 of 4,000+ indexed repos
- Hotspots: tokeneconomizer/plugin/hosts.py, tokeneconomizer/plugin/sidecall.py, tokeneconomizer/plugin/cli.py, tokeneconomizer/plugin/fold.py, plugin/opencode/tokeneconomizer.ts
- Lowest file: tokeneconomizer/microskills/observe.py
- Dead code: 3 findings

## Maintenance

- Last commit 2026-11-17, first commit 2026-10-13, 202 commits
- 45 contributors, bus factor 2

## Security

- Security findings are shown to signed-in users at https://repowise.dev/repo/microsoft/tokeneconomizer/security

## More

- Page: https://repowise.dev/repo/microsoft/tokeneconomizer
- Ask this codebase: https://repowise.dev/repo/microsoft/tokeneconomizer/chat
- Docs: https://repowise.dev/repo/microsoft/tokeneconomizer/docs
- MCP (signs in with Repowise on first use):
    claude mcp add --transport http repowise https://api.repowise.dev/mcp/microsoft/tokeneconomizer
