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
- Install the plugin or clone the repo.
- Run a conversation with Claude Code.
- Tokentrim automatically trims the tool output and summarizes earlier chat (the compaction window).
- The replay command shows you the token savings for that session.
- Adjust the compaction window or switch to a different strength profile from the dashboard.
What you get / what it costs / limits
- All hooks, 3 strength profiles, replay, dashboard, daily budget guard, cold‑cache alert – free.
- Pro lifetime $49 (first 500 buyers) or Pro monthly $9/month.
- Pro adds a hosted dashboard, Monday digest, weekly budget with 80% alert, Slack totals, and support for up to 3 machines.
- Nothing leaves your machine by default.
- Requires Python 3.9 or newer; tested on macOS and Linux.
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.
Updated 2026-10-30