# AI use cases for Token Economizer (microsoft/TokenEconomizer)

Repo: [microsoft/TokenEconomizer](https://github.com/microsoft/TokenEconomizer) | Use cases: 3 | Page: https://dedupedai.com/use-cases/microsoft-tokeneconomizer/

TokenEconomizer is a plugin that makes coding agents cheaper to run in repositories you use often, without changing the agent. It learns micro-skills (repository facts confirmed across sessions), prunes tools that go unused, and runs a loop guard that redirects a stuck turn. It supports Claude Code, Codex, the GitHub Copilot CLI and Pi, with experimental support for opencode, Cursor Agent and Hermes Agent, and keeps what it learns in ~/.tokeneconomizer.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Cut Claude Code cost in a repository you work in every day: https://dedupedai.com/use-cases/microsoft-tokeneconomizer/cut-claude-code-cost-in-your-repo/
- Add the same cost control to Codex or Copilot CLI: https://dedupedai.com/use-cases/microsoft-tokeneconomizer/add-tokeneconomizer-to-codex-or-copilot/
- Inspect and tune what it learned, pruned and blocked: https://dedupedai.com/use-cases/microsoft-tokeneconomizer/tune-the-loop-guard-and-tool-pruning/

## How to cut Claude Code cost in a repository you work in every day with Token Economizer

Repo: [microsoft/TokenEconomizer](https://github.com/microsoft/TokenEconomizer) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Install the plugin from its marketplace and let it learn from your sessions.

**Who it is for:** A developer whose Claude Code sessions keep rediscovering the same build steps and commands.

**The problem:** Sessions waste tokens rediscovering repository facts and loading tools that never get used.

**The outcome:** Facts stated at session start once three sessions confirm them, and status showing what your sessions cost.

### Steps

1. Run `git clone https://github.com/microsoft/TokenEconomizer.git`
2. Run `claude plugin marketplace add "$PWD/TokenEconomizer"`
3. Run `claude plugin install tokeneconomizer@tokeneconomizer`
4. Start claude, trust the folder and run `/tokeneconomizer:status`
5. Once per machine run `/tokeneconomizer:toolprune refresh-catalog`

### Prompt to paste into your agent

```text
Install microsoft/TokenEconomizer as a Claude Code plugin from a local clone, run /tokeneconomizer:status and /tokeneconomizer:toolprune refresh-catalog, then tell me what it reports.
```

### Caveat

If any part of the plugin fails, the session carries on as if it were not installed.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/microsoft-tokeneconomizer/cut-claude-code-cost-in-your-repo/

## How to add the same cost control to Codex or Copilot CLI with Token Economizer

Repo: [microsoft/TokenEconomizer](https://github.com/microsoft/TokenEconomizer) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Use each agent's plugin marketplace command and check status.

**Who it is for:** A team that uses Codex or the GitHub Copilot CLI instead of Claude Code.

**The problem:** Cost control tools are usually tied to one agent.

**The outcome:** Token Economizer running under Codex or Copilot CLI with the same mechanisms.

### Steps

1. For Codex run `codex plugin marketplace add "$PWD/TokenEconomizer"` then `codex plugin add tokeneconomizer@tokeneconomizer`
2. Start codex, choose Trust and continue, review the hooks, restart and check with `$tokeneconomizer:status`
3. For Copilot CLI run `copilot plugin marketplace add "$PWD/TokenEconomizer"` then `copilot plugin install tokeneconomizer@tokeneconomizer`
4. For Pi run `pi install git:github.com/microsoft/TokenEconomizer` and `/te status`

### Prompt to paste into your agent

```text
Install TokenEconomizer for <codex|copilot|pi> following its README commands, then run its status command and show me the output.
```

### Caveat

Codex before 0.141.0 does not run plugin hooks at all.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/microsoft-tokeneconomizer/add-tokeneconomizer-to-codex-or-copilot/

## How to inspect and tune what it learned, pruned and blocked with Token Economizer

Repo: [microsoft/TokenEconomizer](https://github.com/microsoft/TokenEconomizer) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Use the everyday commands to see facts, restore pruned tools and turn mechanisms on or off.

**Who it is for:** A developer who wants to check that cost cutting is not hurting task success.

**The problem:** An optimizer that silently removes tools or injects facts is hard to trust.

**The outcome:** Visible facts, pruned tools with evidence, and per-repository settings you control.

### Steps

1. Run `microskills` to see the facts it injects and those still forming
2. Run `toolprune` to see the tools it left out and the evidence
3. Run `toolprune restore` to give them back
4. Run `config set microskills=on` (or =off), adding `--global` for every repository

### Prompt to paste into your agent

```text
In this repository, run TokenEconomizer's microskills, toolprune and config commands, list any fact that looks wrong, and restore pruned tools I still need.
```

### Caveat

The loop guard never stops a turn itself; it redirects at most once and then tells you how to stop it.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/microsoft-tokeneconomizer/tune-the-loop-guard-and-tool-pruning/
