Best Claude Code Cost Optimizer

Tokentrim is a free, open‑source toolkit that trims Claude Code output, reads files in ranges, and spools long output to disk. On this site you install the plugin or full clone, then use the dashboard to keep your token usage low and your costs down.

How it works for a single conversation

  1. Install the plugin or clone the repo.
  2. Run a conversation with Claude Code.
  3. Tokentrim automatically trims the tool output and summarizes earlier chat (the compaction window).
  4. The replay command shows you the token savings for that session.
  5. Adjust the compaction window or switch to a different strength profile from the dashboard.

What you get / what it costs / limits

FAQ

Question? How much can I save? Answer: On 135 real conversations, history re‑read was cut by 75%, limits lasted 4.0x longer, and billed cost fell roughly 55‑70%. Shrinking tool output alone saved 6.9%.

Question? Do I need a paid plan? Answer: No. The free plan includes all hooks, replay, and a dashboard. Pro adds extra dashboards and alerts.

Question? Will my data leave my machine? Answer: Nothing leaves your machine by default. The hosted dashboard is only available with the Pro plan.

Get started with Tokentrim

Updated 2026-10-30