A zero-dependency, sub-millisecond Go CLI and MCP sidecar that prunes raw tool outputs (JSON, terminal logs, HTML) before they enter your AI agent's context window.
Cut LLM context token consumption by 60% to 80% without using a second LLM summarization turn.
For instant pre-compiled binaries and turnkey configuration files, grab the Pro Kit on Gumroad: 👉 Download TokenCompress Pro ($29)
.exe), macOS (Apple Silicon & Intel), and Linux (x86_64 / arm64).claude_desktop_config.json templates for Claude Desktop, Cursor, and Windsurf.install.sh and install.ps1 scripts for instant global setup without Go toolchain dependencies.When AI agents execute tools (calling APIs, running terminal commands, or scraping web pages), they receive thousands of lines of raw, unparsed data:
tokencompress acts as a high-speed filter between your tools and your model:
tokencompress_json): Retains representative schema examples and replaces redundant array items with metadata (_omitted_items_count: N).tokencompress_log): Strips internal framework paths and isolates user stack traces and root exceptions.tokencompress_html): Strips scripts, styles, and navigation tags to output clean, structured Markdown text.Download the Pro Kit ($29) from Gumroad, extract the package, and run the included installer:
# macOS / Linux
chmod +x install.sh && ./install.sh
# Windows (PowerShell)
.\install.ps1
# Compress a large JSON response
cat large_response.json | tokencompress --mode json
# Prune a verbose stack trace log
cat app.log | tokencompress --mode log --log-internal-marker "mycompany/internal"
# Clean raw HTML scrapes
curl -s [https://example.com](https://example.com) | tokencompress --mode html
| Input Payload | Raw Token Count | Compressed Token Count | Token Reduction | Execution Time |
|---|---|---|---|---|
| JSON Array (500 items) | ~12,500 tokens | ~850 tokens | 93.2% | < 0.4ms |
| Python Stack Trace | ~3,200 tokens | ~410 tokens | 87.1% | < 0.2ms |
| HTML Web Scrape | ~18,000 tokens | ~2,100 tokens | 88.3% | < 0.8ms |
Need a custom high-performance MCP proxy, specialized parsers for enterprise tools, or custom team context rules?
MIT License.
7 commits
Go
93.0%
Python
3.0%
Shell
2.8%
Makefile
1.2%
A zero-dependency, sub-millisecond Go CLI and MCP sidecar that prunes raw tool outputs (JSON, terminal logs, HTML) before they enter your AI agent's context window.
Cut LLM context token consumption by 60% to 80% without using a second LLM summarization turn.
For instant pre-compiled binaries and turnkey configuration files, grab the Pro Kit on Gumroad: 👉 Download TokenCompress Pro ($29)
.exe), macOS (Apple Silicon & Intel), and Linux (x86_64 / arm64).claude_desktop_config.json templates for Claude Desktop, Cursor, and Windsurf.install.sh and install.ps1 scripts for instant global setup without Go toolchain dependencies.When AI agents execute tools (calling APIs, running terminal commands, or scraping web pages), they receive thousands of lines of raw, unparsed data:
tokencompress acts as a high-speed filter between your tools and your model:
tokencompress_json): Retains representative schema examples and replaces redundant array items with metadata (_omitted_items_count: N).tokencompress_log): Strips internal framework paths and isolates user stack traces and root exceptions.tokencompress_html): Strips scripts, styles, and navigation tags to output clean, structured Markdown text.Download the Pro Kit ($29) from Gumroad, extract the package, and run the included installer:
# macOS / Linux
chmod +x install.sh && ./install.sh
# Windows (PowerShell)
.\install.ps1
# Compress a large JSON response
cat large_response.json | tokencompress --mode json
# Prune a verbose stack trace log
cat app.log | tokencompress --mode log --log-internal-marker "mycompany/internal"
# Clean raw HTML scrapes
curl -s [https://example.com](https://example.com) | tokencompress --mode html
| Input Payload | Raw Token Count | Compressed Token Count | Token Reduction | Execution Time |
|---|---|---|---|---|
| JSON Array (500 items) | ~12,500 tokens | ~850 tokens | 93.2% | < 0.4ms |
| Python Stack Trace | ~3,200 tokens | ~410 tokens | 87.1% | < 0.2ms |
| HTML Web Scrape | ~18,000 tokens | ~2,100 tokens | 88.3% | < 0.8ms |
Need a custom high-performance MCP proxy, specialized parsers for enterprise tools, or custom team context rules?
MIT License.
7 commits
Go
93.0%
Python
3.0%
Shell
2.8%
Makefile
1.2%