Token Optimizer plugin

token-optimizer

A plugin for Claude Code and Codex: trims wasted tokens, keeps work alive across sessions and compactions and shows cost. The license is noncommercial

  • 2,541 ★ on the repository
  • Last commit
Plugin

Extended access

Why this level

  • Hooks read session summaries
  • The license is not open: commercial use needs special terms
All reasons and checks

alexgreensh/token-optimizer

Install

Manual install

/plugin marketplace add alexgreensh/token-optimizer
/plugin install token-optimizer@alexgreensh-token-optimizer

Turning on marketplace auto-update is recommended. For Codex there is a .codex-plugin package.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Hooks read session summaries
  • The license is not open: commercial use needs special terms

This is third-party code. Review the repository files before installing.

What it does

Token Optimizer cuts the tokens an AI coding assistant wastes, keeps work alive across sessions and context compactions and shows cost on a live dashboard. Per the README it finds ghost tokens, helps survive context compaction and avoid quality decay during long work. A zero telemetry mode is declared, and there are a PRIVACY.md and checksums. It works on macOS, Linux and Windows. For Claude Code it installs as a plugin, and for Codex there is a `.codex-plugin` package.

Who it is for. For people who work a lot in Claude Code or Codex in long sessions and want to see token spending and not lose context after compaction.

Good fit when

  • Sessions with the agent are long and quality drops after context compaction
  • You need to see cost and token spending on a live dashboard
  • You need to keep the work state across sessions

Not a fit when

  • You use the plugin in a commercial company: the PolyForm Noncommercial license requires separate terms
  • You need an open license: this plugin is not open

Example request

Show which sources eat the most tokens in the current session and suggest what can be trimmed

Limitations

The PolyForm Noncommercial 1.0.0 license is not open: noncommercial use is free, small businesses have an additional permission in the `LICENSE-SMALL-BUSINESS.md` file, and otherwise companies need a commercial license. Read both files before installing. The plugin works through hooks and session summaries, so it has extended access to them. Cloud claude.ai/code sessions do not read plugins from your machine. The declared zero telemetry comes from the README and we did not verify it. The latest version is 5.13.35 from 05.10.2026.

How to disable. Remove the plugin with /plugin uninstall token-optimizer in Claude Code and turn off marketplace auto-update if you enabled it.

FAQ

What is the plugin's license?

PolyForm Noncommercial 1.0.0: noncommercial use is free, small businesses have an additional permission, and others need a commercial license. The license is not open.

How do I install it in Claude Code?

/plugin marketplace add alexgreensh/token-optimizer and /plugin install token-optimizer@alexgreensh-token-optimizer.

Is there a version for Codex?

Yes, the repository has a .codex-plugin package.

Does the plugin send data out?

The README declares zero telemetry and there is a PRIVACY.md. We did not verify this.

Discussion

No questions or reviews yet.

Plugins

Token Monitor

token-monitor

A desktop widget for tracking tokens, cost and limits across 43 or more tools: Claude Code, Codex, Cursor, OpenRouter and others, for Windows and macOS

CLIExtended access2.9KRepository stars

Tokscale

tokscale

A CLI with an interactive TUI that tracks token usage and cost across AI coding agents: Claude Code, Codex, Copilot, Cursor and more

CLIExtended access5.7KRepository stars

Shows what Claude Code and Codex actually send to the API: it captures local traffic and splits tokens and cost by source

CLIBroad access4.7KRepository stars

Claude Code Tools

claude-code-tools

A set of practical tools for Claude Code, Codex CLI and similar agents: utilities, skills, agents, hooks and plugins for terminal work

CLIExtended access2KRepository stars

Claude Usage

claude-usage

A local dashboard from Claude Code logs: tokens, models, sessions and projects. For Pro and Max subscribers it shows the full picture instead of a gauge

CLIMinimal access2.3KRepository stars

A Zig utility for switching Codex accounts: importing an auth file, listing, switching, for the CLI, VS Code and the app

CLIBroad access2.8KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialRepository starsMain difference
Token Optimizer (this entry)no2,541
cost-xrayno4,696captures local API traffic and splits tokens and cost by source
Token Monitorno2,949a desktop widget tracking tokens, cost and limits for many tools
Claude Usageno2,266a local dashboard over Claude Code logs: tokens, models, sessions and projects

README in short

The README describes a plugin for trimming wasted tokens, keeping work across sessions and showing cost, installed through the Claude Code marketplace with a Codex package. PolyForm Noncommercial 1.0.0 license and a separate permission for small business.

README badge

Report a problem

Foxx AIToken Optimizer
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.