This page is also available in

Home › Vibe Coding / AI Programming › token-defrag

token-defrag

yuseferi/token-defrag

Vibe Coding / AI Programming Source: GitHubScore 1.9· #37 on the hot list3 stars/day (21 total)· First listed Dec 2, 2026

Visit the token-defrag website / project page →

Verdict Worth trying for developers doing long debugging sessions with Claude Code;but Claude itself requires a VPN from China and token savings are mainly noticeable with English prompts

What is token-defrag

Token-Defrag is a tool that reduces repeated context transmission in Claude Code and OpenCode, significantly lowering prompt token usage (in testing, failure logs reduced by 66.5% and prompt tokens by 28.4%). It supports an optional live mode and does not collect telemetry data.

Key features

  • Shortens repeated tool outputs in Claude Code and OpenCode, reducing prompt token consumption
  • Automatically summarises earlier conversation turns and rebuilds prompt cache only when savings are significant
  • Supports optional live mode for instant context compression during long single debugging or refactoring sessions
  • Keeps local backups of original content and automatically falls back to the original request if API validation fails
  • Provides a stats command to view compressed request counts and estimated token savings

Who it is for

Developers using Claude Code or OpenCode for long debugging, refactoring or multi-turn conversations, especially those concerned about token costs.

Who it is NOT for

Materials do not specify who this is not for.

How to get started

  1. Visit https://github.com/yuseferi/token-defrag
  2. Install tokendefrag via brew install --cask yuseferi/tap/tokendefrag or the curl install script
  3. Run tokendefrag claude --live to enable live rewriting in the current session
  4. Use tokendefrag stats --since 1d to view savings statistics

Pricing:Not published

Compiled from public descriptions on the tool's official website / README / launch page. Pricing and user numbers have not been verified; please check the official website. Some sections were drafted with AI assistance. Written in Chinese and English.

Similar alternatives (Vibe Coding / AI Programming)

Get a “Featured on AI Hot List” badge · Submit a tool

← Back to “Vibe Coding / AI Programming” · Full hot list · Use-case lists