The Problem CMX Solves
Long coding sessions accumulate enormous context. Every new request carries the full history of earlier turns: superseded attempts, resolved errors, and exchanges the model no longer needs word-for-word. Your provider charges for every input token in that payload, so the longer a session runs, the more you pay just to re-send history that doesn’t change the answer. Most tools that address this problem use static heuristics to decide what to drop. The result is unpredictable: useful context disappears, or nothing gets trimmed at all.How CMX Helps
CMX takes a model-directed approach. When a session grows past a configurable threshold, CMX asks your model to propose a factual summary of eligible older turns. Before applying anything, a deterministic gateway policy checks the proposal against four criteria:- Protected tool calls —
task,skill,write, andeditcalls and their results are never touched. - Recent context — the most recent turns are always preserved in full.
- Estimated savings — compression only proceeds when the net token saving is positive.
- Opaque content — anything CMX cannot safely parse passes through unchanged.
127.0.0.1:17322 and proxies requests to the provider you already use — your provider credentials are never seen by CMX.
Who It’s For
CMX is built for developers who use AI coding agents and want their API bill to shrink automatically. It works with:- Codex — verified integration with automatic harness setup
- OpenCode — verified integration with per-provider connection
- Any OpenAI- or Anthropic-compatible agent — any tool that accepts a custom base URL and speaks OpenAI Chat Completions, OpenAI Responses, or Anthropic Messages
Privacy & Security
CMX is local-first by design. The gateway binds exclusively to127.0.0.1:17322 — it never listens on a network-accessible interface. Your prompts, source code, and model responses travel only between your machine and your configured provider. CMX servers never receive your conversation content.
Provider credentials are held in memory for the lifetime of the gateway process and are never written to disk. The only data that leaves your device is a signed aggregate counter sent to your CMX account — a total of tokens handled and saved, with no attached content.
Quick Start
Install CMX, sign in, and connect your coding agent in four steps.
How Compression Works
Understand the policy checks and model-directed summarization behind CMX.