Skip to content

Performance

The whole point of cmx is that compression pays for itself. This page explains where the savings come from and what they cost you.

Where the tokens actually go

AI coding harnesses resend the full conversation history on every turn. Nothing is ever dropped, so old tool output, logs and dead-end exploration ride along forever.

Resend tax

A 300-turn session can carry hundreds of thousands of tokens — most of it stale context the model never needs again.

Cache fees dominate

On long agentic sessions, cache-read fees routinely account for 80%+ of total inference spend. You pay repeatedly to re-read history.

Compression is the lever

Replacing a 40k-token stale span with a 600-token summary removes both the resend and the re-read — every turn after it.

Measured on real sessions

Numbers from the production gateway running live workloads, read straight from cmx's own metrics.

46% context cut

End-to-end smoke test with the production binary: 1,164 estimated context tokens rewritten to 628 on the first compressed turn.

Savings grow with session length

Short sessions stay untouched — cmx leaves them alone. The longer the session and the noisier the tool output, the bigger the reduction.

Visible in your dashboard

Every session tracks estimated original vs. sent tokens. Run cmx stats or open the web dashboard to see your own numbers.

The cache economics

Compression isn't free: rewriting history invalidates the provider's prompt cache once. cmx only compresses when the math works in your favor.

Once a range is compressed, the next request re-pays input tokens for the rewritten (much smaller) prefix, then the cache rebuilds from the new stable prefix. cmx’s scheduler holds off on compressing until projected savings over the next few turns repay that one-time rewrite — typically within 2–3 turns of threshold. Recent messages are always left verbatim so the hot part of the cache keeps hitting.

For the full mechanics, see How it works.