
OptScale Kompressor
Open source: context compression for coding agents, 63% less tool output
FreeOpen SourceAI AgentsAI Coding2,143 impressions#5 of its week5 comments
Comments
>log in to comment
Update: Kompressor now supports Claude Code. Claude Code was the stubborn case. It keeps 92–95% of its prompt in the provider's cache, so there is almost nothing to compress. Its bill turned out to be driven by something else: the cache expiring while the agent waits on a long tool run, and the whole prefix being written again at full price. So Kompressor now leaves everything the provider has cached byte-identical, compresses only the new tail, and keeps the cache warm while tools run. On Terminal-Bench 2.1 with Claude Code on Opus 5.5, the Anthropic API bill fell 20% with the solve rate unchanged, and on tasks with long-running tools, cost fell 34%. Thanks to everyone who put the first release through real logs: those findings are fixed in this version too. Full write-up: https://optscale.ai/blog/claude-code-prompt-caching
kris gu· 14d agoThe deterministic, cache-safe angle is the part that actually matters — a compressor that shifts output between turns breaks the provider's prompt cache and can end up costing more than it saves. Keeping elided sections retrievable via markers instead of deleting them outright is the right call. Curious: when the model hits a marker, does it refetch the content automatically, or does the agent have to explicitly ask for it?

Hello DevHunt community! A bit of backstory. We run an AI gateway, and when we dug into our traces, about half of what coding agents sent was tool output: build logs, progress bars, the same compiler warnings, re-sent on every turn. So we went looking for a compressor. We spent a lot of time with Headroom, a great project, but for a shared gateway we kept hitting one issue: its output can change from one turn to the next, and every change risks breaking the provider’s prompt cache, the biggest discount on an agent’s bill. Kompressor is what we built instead. Same input, same output, every time, so the cache survives, and anything it cuts can be fetched back. Across 6,255 real tool outputs, it removes 63% of the text, and on Terminal-Bench 2.1 it cut Codex’s real bill on GPT-5.5 by 22.7%. It’s open source under MIT. If you use Codex, run kompressor wrap codex to try it. What’s eating your agents’ context? Curious what you’d want us to handle next.
kompressor wrap codex
Codex is the supported path; wrap also knows opencode, aider and Cursor (with your own OpenAI key).
Kompressor is also the compression engine inside OptScale AI. Full benchmark reports: Codex on GPT-5.5 · Claude Code on Opus 5.5OptScale Kompressor alternatives →More Open Source tools →74 free dev tools →
- Deterministic prompt compression for coding agents
- Rust binary runs locally with no external dependencies
- Reversible token compression saves up to 22.7% on LLM costs
- Integrates with OptScale AI for shared savings dashboards
- Supports multiple compression modes including Headroom and no compression
Deterministic, cache-safe context compression for coding agents that reduces LLM token costs.
- for
- Teams using LLM-powered coding agents and CI/CD pipelines.
- pricing
- freemium · free trial
- license
- MIT
- 1.0.2a month ago
Key features
- Deterministic rule-based compression — Same input always yields identical compressed bytes, preserving prompt-cache discounts.
- Labelled, retrievable elisions — Removed sections are replaced with markers that can be fetched back within an hour.
- Format-specific compressors — Handles build logs, compiler diagnostics, JSON, diffs, source code, and more with custom rules.
- Fails-open safety — A result that isn’t smaller than the input is discarded, and on any error the request passes through unchanged.
- Single Rust binary — One static binary, about 0.2 ms per KB of tool output, with pre-built releases for Linux and macOS.
- Works with your coding agent — Built for Codex and Claude Code; kompressor wrap also supports opencode, aider and Cursor (own OpenAI key). On Claude Code it keeps the cache warm while tools run.
Use cases
- Compress the repetitive build and package logs coding agents re-send to the model
- Keep long agent sessions further from the context window limit (requests over 200K tokens fell from 1.9% to 0.13%)
- Shrink large compiler diagnostic outputs while keeping errors accessible
- Fold progress-bar redraws when coding agents run ML training jobs
- Keep Claude Code's prompt cache warm while long builds and ML training runs execute
OptScale Kompressor vs alternatives
OptScale Kompressor | Cursor | Cline | OpenAI Codex | ||
|---|---|---|---|---|---|
| Best for | Cache-safe token compression for coding agents | AI-enhanced code editing | Autonomous coding agents | Terminal AI agents | LLM coding assistants |
| Pricing | Freemium | Subscription | Free | Free | Subscription |
| DevHunt upvotes | 28 | 1 | 0 | 0 | 0 |
| Launched | Oct 2026 | — | — | — | — |
- OptScale Kompressor vs Cursor: Cursor is an AI-powered code editor; Kompressor is a standalone compression engine for agent output.
- OptScale Kompressor vs Cline: Cline is an autonomous coding agent; Kompressor is not an agent, it compresses the tool output agents send to the model.
- OptScale Kompressor vs Gemini CLI: Gemini CLI is a terminal AI agent; Kompressor is a local proxy that compresses agents' tool output, with Codex and Claude Code as the supported paths.
- OptScale Kompressor vs OpenAI Codex: OpenAI Codex provides coding capabilities; Kompressor optimizes the token cost of Codex’s output.
OptScale Kompressor FAQ
Does compression break the LLM prompt cache?+
No. Kompressor is deterministic, so the compressed output is byte-identical across turns, preserving cache discounts.
What happens if compression makes the request larger?+
The compressor discards the result and passes the original request through unchanged.
Is any machine-generated output left untouched?+
Only output under ~512 bytes, system/assistant messages, and blocks that would break the cache are never compressed.
Can I retrieve the original content after compression?+
Yes. Markers contain a hash reference; the model can call kompressor_retrieve to get the full content back for up to an hour.
Is the tool open source?+
Yes. The engine is an MIT-licensed Rust binary available on GitHub as optscale-kompressor.
What formats does Kompressor support?+
It has rule-based compressors for build logs, package managers, logs, compiler diagnostics, terminal redraws, JSON, tables, diffs, listings, source code, configs, HTML, and plain text.
Edited by the makers, based on optscale.ai · Oct 21, 2026. Details may change; check the official site.
What people say
“OptScale Kompressor is a local Rust-based prompt compressor for coding agents. Its central design choice is deterministic output: repeated input produces identical bytes, helping preserve prompt-cache benefits while retaining removed content for retrieval.”
nav-ai.net
Around the web
OptScale Kompressor in the news
Recent OptScale Kompressor news and updates from DevHunt Daily.
· DevHunt launch
OptScale Kompressor reduces coding agent output by 63% and cuts costs
OptScale Kompressor is an open‑source, deterministic tool that compresses machine‑generated output from coding agents, keeping the same bytes across turns to preserve prompt‑cache discounts. Benchmarks show a 22.7% cost reduction and 25% fewer input tokens without affecting task success rates.
OptScale Kompressor
Cursor
Cline
OpenAI Codex






