Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Python agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcpopenaiprompt-engineeringproxypythonragtoken-optimizationtokenstypescript
{
"config": {
"dedup_identical_items": true,
"enabled": true,
"factor_out_constants": false,
"first_fraction": 0.3,
"include_summaries": false,
"last_fraction": 0.15,
"max_items_after_crush": 15,
"min_items_to_analyze": 5,
"min_tokens_to_crush": 200,
"preserve_change_points": true,
"similarity_threshold": 0.8,
"toin_confidence_threshold": 0.5,
"uniqueness_threshold": 0.1,
"use_feedback_hints": true,
"variance_threshold": 2.0
},
"input": {
"bias": 1.0,
"content": "[]",
"query": ""
},
"input_sha256": "41ecf20098c599d75649f87718e0160024927b289bf03f635d5be1dca68bfda9",
"label": "empty_array",
"output": {
"compressed": "[]",
"original": "[]",
"strategy": "passthrough",
"was_modified": false
},
"recorded_at": "2026-04-27T06:59:40.029560+00:00",
"transform": "smart_crusher"
}