TOON Compression: Lossless JSON Token Reducer
Cut JSON token spend by 35%–60% across Claude Code, Cursor, AGY, and Cline with lossless TOON conversion via FastMCP daemon and PTY paste wrapping.
$9
Works with the AI Agents you already use
TOON Compression: Lossless JSON Token Reducer
Example session with this skill installed
Optimize our 1,200-row user table export and measure token savings before injecting it into the Claude context window.
- Read your context and instructions
- Compiled the toon compression
$ # 1. Inspect an uncompressed 1,200-row JSON database export:
$ ls -lh database_dump.json
-rw-r--r-- 1 v v 482K Nov 15 14:10 database_dump.json
$ # 2. Measure baseline token consumption using standard tokenizer:
$ python3 -c "import tiktoken; enc = tiktoken.get_encoding('cl100k_base'); print('Baseline Tokens:', len(enc.encode(open('database_dump.json').read())))"
Baseline Tokens: 114,820
$ # 3. Execute TOON lossless compression via FastMCP CLI tool:
$ toon-mcp convert --input database_dump.json --output database_dump.toon
[TOON] Successfully converted database_dump.json -> database_dump.toon
[TOON] Original Size: 482.0 KB | TOON Size: 218.4 KB | Reduction: 54.68%
$ # 4. Validate token savings on compressed payload:
$ python3 -c "import tiktoken; enc = tiktoken.get_encoding('cl100k_base'); print('TOON Tokens:', len(enc.encode(open('database_dump.toon').read())))"
TOON Tokens: 51,218 (Saved 63,602 tokens | 55.4% reduction!)
$ # 5. Seamlessly restore to identical JSON structure with zero data loss:
$ toon-mcp restore --input database_dump.toon --output verified.json
$ diff -u <(jq -S . database_dump.json) <(jq -S . verified.json)
$ echo "Integrity Check: PASSED (Exact semantic parity maintained)"
Integrity Check: PASSED (Exact semantic parity maintained)
Connects securely to your tools. The creator never sees your data.
About this skill
Agensi Turnkey Convenience Package ($9): While the core codebase remains open-source MIT on GitHub, this official Agensi package delivers turnkey agent installation, verified
install.shautomation, the curatedSKILL.mdagent instruction suite, ongoing compatibility updates, priority support, and instant zero-config activation across Claude Code, Cursor, Cline, and Antigravity CLI.
Eliminate JSON Token Waste in LLM Agent Workflows
Large JSON payloads (API responses, AST syntax trees, database records, and directory manifests) quickly exhaust model context windows and cause massive token billing spikes.
TOON (Token-Optimized Object Notation) is a lossless, structural serialization format designed specifically for LLM attention mechanisms. Coupled with a high-speed Python FastMCP server and a terminal PTY paste wrapper (toon-wrap), toon-compression automatically strips structural whitespace and repetitive syntax tokens while preserving 100% data fidelity.
Core Capabilities:
- 35% to 60% Token Savings: Proven reduction on structured arrays, tabular data, and nested objects.
- Lossless Two-Way Conversion: Convert JSON to TOON before model ingestion; restore to valid JSON on return.
- Tool Schema Pruning: Analyze parameter schemas and filter unused fields before calling external APIs.
- Terminal PTY Interception:
toon-wraptransparently compresses bracketed pastes into AI coding terminals without buffer overflow.
See It in Action (Demo)
$ # 1. Inspect an uncompressed 1,200-row JSON database export:
$ ls -lh database_dump.json
-rw-r--r-- 1 v v 482K Nov 15 14:10 database_dump.json
$ # 2. Measure baseline token consumption using standard tokenizer:
$ python3 -c "import tiktoken; enc = tiktoken.get_encoding('cl100k_base'); print('Baseline Tokens:', len(enc.encode(open('database_dump.json').read())))"
Baseline Tokens: 114,820
$ # 3. Execute TOON lossless compression via FastMCP CLI tool:
$ toon-mcp convert --input database_dump.json --output database_dump.toon
[TOON] Successfully converted database_dump.json -> database_dump.toon
[TOON] Original Size: 482.0 KB | TOON Size: 218.4 KB | Reduction: 54.68%
$ # 4. Validate token savings on compressed payload:
$ python3 -c "import tiktoken; enc = tiktoken.get_encoding('cl100k_base'); print('TOON Tokens:', len(enc.encode(open('database_dump.toon').read())))"
TOON Tokens: 51,218 (Saved 63,602 tokens | 55.4% reduction!)
$ # 5. Seamlessly restore to identical JSON structure with zero data loss:
$ toon-mcp restore --input database_dump.toon --output verified.json
$ diff -u <(jq -S . database_dump.json) <(jq -S . verified.json)
$ echo "Integrity Check: PASSED (Exact semantic parity maintained)"
Integrity Check: PASSED (Exact semantic parity maintained)
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed today
Requires
Permissions
File Scopes
FastMCP server runs locally via stdio. No network traffic or external API calls.