Make Large Claude Code Outputs Smaller
Before They Hit Context

GitHub stars

Compresses large JSON, logs, and stack traces before they enter the context window. 48% average token savings across structured data and debug output.

Open source • Local-first • MIT licensed

At a Glance

The shortest way to see whether Toonify fits your workflow, how to install it, and how to check it is working.

BEST FOR
Large JSON, YAML, logs, and test output.
DEFAULT PATH
Install plugin mode first and keep the normal Claude Code workflow.
HOW TO VERIFY
toonify-mcp setup, toonify-mcp doctor, and toonify-mcp status for the latest optimized or skipped outcome.
LESS IDEAL
Short prose, tiny files, and formatting-sensitive content where exact layout matters more than token cost.

Best for Large Tool Output

Toonify is most useful when the heavy part of your session comes from tool output, not from normal chat.

BEST FIT

Large structured payloads

Teams reading large JSON, YAML, API responses, and generated data into Claude Code.

ALSO USEFUL

Debug-heavy sessions

Test failures, stack traces, compiler diagnostics, and repetitive lint/build output where the signal matters more than every repeated line.

NOT IDEAL

Small or prose-first tasks

If your context is mostly short prose, very small files, or content that depends heavily on original formatting, the gains are usually limited.

See the Difference in One Glance

Same session, less weight.

Before Optimization (142 tokens)

{ "products": [ {"id": 101, "name": "Laptop Pro", "price": 1299}, {"id": 102, "name": "Magic Mouse", "price": 79} ] }

After Optimization (57 tokens, -60%)

[TOON-JSON] products[2]{id,name,price}: 101,Laptop Pro,1299 102,Magic Mouse,79
Automatically applied in Plugin mode - no manual calls needed.

Start With the Default Path

Plugin mode is the fastest way to start. Use MCP server mode only when you want manual control.

Recommended: Plugin Mode

Best for most Claude Code users. Install once and supported output is handled automatically.

# Download the repository git clone https://github.com/PCIRCLE-AI/toonify-mcp.git cd toonify-mcp # Install deps and build npm install npm run build # Install globally from local source npm install -g . # Let Toonify handle marketplace + install or update toonify-mcp setup # Verify installation toonify-mcp doctor

Result: supported large output is reduced automatically after tool use.

If you already have an older local install, toonify-mcp setup updates it automatically.

Advanced: MCP Server Mode

Use this when you want manual control or need to connect Toonify to another MCP client.

# Register Toonify as an MCP server toonify-mcp setup mcp # Verify claude mcp list # Should show: toonify: toonify-mcp - ✓ Connected

Best for advanced setups or non-Claude Code MCP clients.

Any Agent CLI: Pipe Filter

Not limited to Claude Code. Output is compressed before it enters the model's context, so it works with any agent CLI and never breaks a pipe.

# Pipe any command's output through the filter curl -s https://api.example.com/users | toonify-mcp compress

Add a rule to your project's agent instructions (e.g. AGENTS.md) so the agent adopts it on its own.

On-Demand: OpenAI Codex CLI

Registers Toonify as an MCP server for Codex, so it can call the optimize_content tool when needed.

# Register Toonify with Codex toonify-mcp setup codex

On Codex this is on-demand, not automatic — Codex's hooks can't yet replace tool output the way Claude Code's plugin mode does. For automatic compression on Codex, use the pipe filter above.

Features

Install once. Runs automatically. Zero workflow changes.

🎯

Automatic in Plugin Mode

Install once and supported output is handled automatically in normal Claude Code use.

toonify-mcp setup
🧭

Workflow Stays the Same

Teams keep the same workflow instead of learning a new one.

📦

Large Structured Payloads

Built for large JSON, YAML, API responses, and generated output that would otherwise bloat context.

🧪

Debug Output Compression

Helps with long test failures, stack traces, compiler diagnostics, and repetitive lint or build output.

🔄

Dual Mode

Use plugin mode for automatic handling or MCP mode for manual control.

⚖️

Selective Optimization

Large content is only compressed when the estimated savings are worth it.

📊

Local Metrics and Safe Fallback

You can check local activity, and Toonify falls back to the original content when reduction is not worth it.

🧵

Works With Any Agent CLI

toonify-mcp compress is a stdin→stdout pipe filter — not limited to Claude Code or MCP clients.

🤖

OpenAI Codex CLI Support

Register Toonify as an MCP server for Codex with one command, available on demand.

Benchmark Snapshot

Enough proof to decide whether it is worth trying. Details live in the benchmark page and README.

12
Fixtures
48.1%
Average Savings
24.5-66.3%
Observed Range

Want the details?

Open the benchmark summary, README, or LLM summary when you need the longer explanation.

Try It on a Real Claude Code Session

Install plugin mode in under a minute. Use MCP server mode when you need manual control.