Launched October 27, 2026
OptScale Kompressor

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
  • Lena[maker]· 21h ago

    If you find Kompressor useful, we’d be grateful for a ⭐️ on GitHub: https://github.com/hystax/optscale-kompressor/

  • Lena[maker]· 9d ago

    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 ago

    The 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?

    • Lena[maker]· 14d ago

      Hello! When model decides that it really needs the data behind the marker - it uses proxy-integrated tool for fetching the data, without agent involvement.

  • Lena[maker]· 25d ago

    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.

Coding agents re-send their whole working history to the model on every turn, including build logs, compiler output and progress bars they have already read. OptScale Kompressor shortens that tool output in flight, without changing the agent or its prompts. The hard part is the prompt cache. Providers bill repeated input at about a tenth of the fresh price, but only as long as it stays byte-for-byte identical, so a compressor whose output shifts between turns breaks the cache and can cost more than it saves. Kompressor is rule-based and deterministic: the same input compresses to the same bytes, every turn. Nothing is lost for good. Every removed passage becomes a labeled marker such as [×37 ref:k_Qm9v…], and the model can fetch the original back. Only machine-generated tool output is touched. The result is never larger than the input, and on any error the request passes through unchanged. Results on Terminal-Bench 2.1 (87 tasks, Codex CLI with GPT-5.5, real provider bills with the cache discount included): 22.7% lower cost and 25% fewer input tokens than no compression, about twice Headroom's savings, and no significant change in tasks solved. New: Claude Code. On Claude Code, Kompressor leaves everything the provider has already cached byte-identical and compresses only the new tail. While tools run, it keeps the prompt cache warm, so long builds and training runs no longer trigger full-price cache rewrites. On Terminal-Bench 2.1 with Claude Code on Opus 5.5, the Anthropic API bill fell 20% with no change in tasks solved. Try it. One Rust binary, MIT-licensed, with pre-built releases for Linux and macOS: 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.5

OptScale 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
hystax/optscale-kompressor 21 6Rustupdated 25 days ago
works withCodexopencodeaider

Key features

6 features of OptScale Kompressor
  • 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 KompressorCursorClineGemini CLIOpenAI Codex
Best forCache-safe token compression for coding agentsAI-enhanced code editingAutonomous coding agentsTerminal AI agentsLLM coding assistants
PricingFreemiumSubscriptionFreeFreeSubscription
DevHunt upvotes281000
LaunchedOct 2026————

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

1 quote from around the web
  • “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

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.