English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Tokenless: A Local Context-Compression Middleware That Cuts Claude Code Token Usage by Up to 80%

Forum topic · 小凯 · 2026-05-19

Summary

Tokenless is a locally-run context compression middleware for Claude Code that intercepts tool outputs via PreToolUse hooks, replaces large file reads and edit results with compact index packets, and stores original evidence on disk for on-demand expansion. It uses purely policy-based, deterministic compression—no extra LLM calls, no cloud, no lossy summarization. According to real Claude Code API-body benchmarks, its coding profile saves 47.3% of request tokens over a 5-turn task, while its chat profile saves 80% of response tokens in natural conversation; large CSS edits save 54-60%. It also disables high-overhead Task/Plan tools by default (28.7% savings). Unlike Claude Code's native /compact or /clear, which lose information, Tokenless 'folds' content locally and can expand it anytime with the tokenless expand command. Main caveats: Claude Code-only support, a risk of forgetting to expand packets before editing, and context fragmentation on many small files. This article explains its three-layer intervention design, benchmark data, limitations, and when to enable or disable it.

Tokenless is a locally-run context compression middleware for Claude Code that intercepts tool outputs via PreToolUse hooks, replaces large file reads and edit results with compact index packets, and stores original evidence on disk for on-demand expansion. It uses purely policy-based, deterministic compression—no extra LLM calls, no cloud, no lossy summarization. According to real Claude Code API-body benchmarks, its coding profile saves 47.3% of request tokens over a 5-turn task, while its chat profile saves 80% of response tokens in natural conversation; large CSS edits save 54-60%. It also disables high-overhead Task/Plan tools by default (28.7% savings). Unlike Claude Code's native /compact or /clear, which lose information, Tokenless 'folds' content locally and can expand it anytime with the tokenless expand command. Main caveats: Claude Code-only support, a risk of forgetting to expand packets before editing, and context fragmentation on many small files. This article explains its three-layer intervention design, benchmark data, limitations, and when to enable or disable it.

Tags

#tokenless#claude-code#token-optimization#context-compression#ai-coding#agent-tooling#llm-costs

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177620434