
Every time your coding agent runs a test, installs a package, or hits a compiler error, it re-sends its full working history to the model. That means every progress bar, every repeated warning, every verbose package manager line goes back across the wire on the next turn. Hystax just open-sourced a Rust binary called OptScale Kompressor that strips this machine-generated noise before it reaches the model — no changes to your agent required. In their Terminal-Bench 2.1 tests, it cut the provider bill by 22.7%.
Why Your Agent’s Bill Is Mostly Noise
The uncomfortable truth about coding agent costs is that you’re not primarily paying for the model to think. You’re paying for it to re-read the same compiler warnings it already saw three turns ago.
Stateless LLM APIs require the agent to resend its entire conversation history on every call. When you’re doing a real coding session — running tests, iterating on failures, installing dependencies — that context window fills up fast with machine-generated output that carries almost no signal for the next step. According to Vantage.sh, agentic coding tools burn 10 to 100 times more tokens than a chat window. The average Claude Code user spends $400–$800 per month on API costs. Heavy users hit $1,500–$3,000.
The knee-jerk fix is to switch to a cheaper model. That’s the wrong move. The overhead problem follows you to any model you pick.
What Kompressor Does
OptScale Kompressor sits between your coding agent and the LLM API. It intercepts the outgoing context, strips redundant machine-generated output — build logs, compiler messages, progress bars, repeated package manager lines — and sends a compressed version to the model instead. The original output is not deleted; it is compressed and retrievable if the agent needs it back.
The key design choice is what it does not use: machine learning. Kompressor is entirely rule-based. No model runs locally. No inference overhead. It processes tool output in roughly 1/440th of the time that Headroom’s ML-based compression approach requires. In a long coding session with hundreds of tool calls, compression cannot become a bottleneck itself.
The Cache Angle Nobody Is Talking About
Here is the part that makes Kompressor genuinely interesting beyond raw token savings: deterministic compression keeps your prompt cache hits intact.
LLM providers — Anthropic, OpenAI, Google — all offer cache discounts when repeated prefixes appear in context. If your context changes between turns, even slightly, you lose those discounts. Headroom’s ML approach produces slightly different output each run, breaking cache consistency. Kompressor produces the exact same bytes for the same input every time. Your cached prefixes survive compression, and you stack the cache discount on top of the compression savings.
How to Install and Run It
Pre-built binaries are available for Linux (x86_64, arm64) and macOS (arm64, x86_64) on the Releases page. If you have Rust 1.90 or newer:
cargo install --locked --git https://github.com/hystax/optscale-kompressor kompressor-cli
Once installed, wrapping your agent is a one-command operation:
# Claude Code
kompressor wrap claude
# Codex
kompressor wrap codex
# aider
kompressor wrap aider
# Check all supported agents
kompressor wrap --list
The wrap command launches your agent with Kompressor as a transparent proxy. No config changes to the agent itself. When running with Codex, it temporarily patches ~/.codex/config.toml at startup and cleans up on exit. If a session gets killed unexpectedly, run kompressor unwrap codex to remove any leftover config block.
For teams running agents in CI or on shared infrastructure, kompressor serve starts a local MCP server on 127.0.0.1:8817 with endpoints for compression, retrieval, and stats.
Kompressor vs Headroom
Headroom is the main prior art here — also open-source, also targeting coding agent context overhead. Hystax’s benchmarks on Terminal-Bench 2.1:
| Kompressor | Headroom (default) | |
|---|---|---|
| Bill reduction | 22.7% | 8.2% |
| Input token cut | 25% | ~11% |
| Task success rate | 81.1% | ~82% |
| Approach | Rule-based (deterministic) | ML + rules |
| Cache-safe | Yes | No |
| Speed | 440x faster compression | Baseline |
Fair caveat: these are Hystax’s own numbers, run on Hystax’s benchmark. Independent replication has not been published yet. The 22.7% figure applies to Terminal-Bench 2.1 — heavy on build and test cycles. Agents doing mostly code generation with minimal tool output will see smaller gains.
What It Won’t Fix
Kompressor targets machine-generated noise. Structured JSON responses, code diffs, and developer messages are left untouched. If your agent mostly generates code without heavy tool-call cycles, savings will be modest. The sweet spot is agents running in CI, doing multi-step builds, or working on large repos where compilation and test output dominates the context window.
There is also a 1.1% task success drop to acknowledge (81.1% vs 82.2% without compression). Hystax calls this statistically insignificant, and it likely is. But if your agent is already operating near its ceiling, compressing critical tool outputs could occasionally tip a close call. The retrievable compression mechanism exists precisely for this scenario — the agent can request the full output when it needs detail.
The Bigger Picture
What makes Kompressor worth watching is not just the 22% savings. It is the framing: context overhead as a first-class optimization target, not an unfortunate side effect of LLM architecture. Hystax built OptScale for AWS and Azure cost optimization before anyone was talking about AI spend. That FinOps discipline, applied to coding agents, is overdue.
The free tool feeds into their commercial OptScale AI platform for teams. Classic open-core playbook. For individual developers and small teams, the free version is what matters, and it is worth two minutes to try. Install it, run a session, check kompressor stats. The number will tell you whether it is worth keeping.













