Tokencompress Cuts AI Agent Token Use by 60-80% for Tool Outputs
TL;DR. Tokencompress offers a sub-2ms Go CLI and sidecar solution to prune raw tool outputs, significantly reducing AI agent context token consumption. - The tool filters large JSON payloads, verbose stack traces, and raw HTML before inputting to LLMs. - It achieves token reductions between 60% and 80%, lowering API costs and improving agent performance. - Tokencompress operates as a high-speed, deterministic filter for tools to model interactions.
- Tokencompress is a Go CLI and MCP sidecar designed to optimize AI agent context windows.
- It prunes raw tool outputs like JSON, logs, and HTML, which often bloat LLM prompts.
- The solution cuts LLM context token consumption by 60% to 80% without needing a second LLM summarization turn.
- Benchmarks show 87-93% token reduction for common data types like JSON arrays, Python stack traces, and HTML web scrapes.
- It addresses issues of high API costs, slow response times, and context rot in AI agents.
- Features include JSON truncation, log pruning, HTML cleaning, and duplicate loop detection.
Sources
- Tokencompress A sub-2ms Go CLI and MCP sidecar that prunes AI agent tool context — github.com
- news.ycombinator.com — news.ycombinator.com