Claude Code Token Trimmer

Yes, this is the free, open‑source toolkit that trims Claude Code output and compacts conversation history. Install it as a plugin or clone the repo, then use the dashboard to manage tokens locally.

How it works for a single Claude Code session

  1. Run Claude Code with the tokentrim hook enabled.
  2. The hook trims each tool’s output and writes long results to disk.
  3. When the conversation reaches the compaction window, tokentrim summarizes earlier messages (full install only).
  4. The replay command shows your own token‑saving numbers.

What you get and the cost

FAQ

Does anything leave my machine? No. All processing stays on your computer unless you choose the hosted Pro dashboard.

What Python version do I need? Python 3.9 or newer. The toolkit is tested on macOS and Linux.

How much can I expect to save? In the author’s 135 real conversations, summarising the conversation cut history re‑read by 75%, extended limits by about 4.0×, and reduced billed cost by roughly 55‑70%. Trimming tool output alone saved 6.9%.

Get started with Claude Code Token Trimmer

Updated 2026-10-28