TOON Compression: Lossless JSON Token Reducer

    1

    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

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    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)

    ls -lh database_dump.json

    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.sh automation, the curated SKILL.md agent 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-wrap transparently 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Python 3.10+
    pip / venv
    FastMCP / =0.9.0 MCP
    Toon MCP
    Python

    Permissions

    File Scopes

    ~/.local/bin
    ~/.local/share/toon-venv

    FastMCP server runs locally via stdio. No network traffic or external API calls.

    Listedtoday

    What's inside

    Frequently Asked Questions

    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.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use TOON Compression: Lossless JSON Token Reducer on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in LLM Ops