one daemon holds your sessions. helpers park between tasks instead of dying.
how it works · quickstart · usage · docs
a coding agent that runs as a daemon on your machine. you talk to it from a web app, a script or a terminal, and it reads and edits your code, runs commands, and hands subtasks to cheaper helper agents. sessions live in the daemon, not the client. run it as a service and a turn keeps going after you close the client, and you can pick the same session up later from your phone.
cmx2 builds on pi, an open source agent library (pinned to one exact version). pi runs the model loop. cmx2 is the runtime around it.
status: pre-1.0. the daemon, the http contract and its clients work end to end. breaking changes are possible between minor versions and are listed in the changelog.
i can't use a tool without wanting to change it. in february i forked opencode, another coding agent, and called it cmx. by september the fork was a pile of my patches on top of a version upstream had already moved past. it was slow, used enough memory that i'd restart apps to get it back, and carried features i'd spent months deleting. merging was never going to happen.
so i started over. wishlist first, base second. i looked at goose, codex and pi, three open source agents, and picked pi because it was small and stayed out of the way. then i took the best ideas from the others: the model thinks harder or lighter turn by turn, helper agents stick around after a task so the next one starts with their context, and a helper can get its own checkout of the repo when the work needs one. cmx had taught me that most of the cost was the main agent re-reading its own history, so cmx2 keeps the start of every request identical and the provider's cache serves it cheaply.
the rule i kept coming back to is rich sutton's bitter lesson. as models get smarter, the harness (everything around the model) should decide less for them. cmx2 gives the model tools and limits and lets it choose when to hand work off.
it's not a product. it's what i run all day, mostly from boxbox. it's open source because it finally installs like a real program, and maybe it's useful to you too.
cmx2 driven from boxbox
one daemon runs per machine and owns every session on it. clients send http requests and read a server-sent event stream; they never talk to a model. cmx2 run and plain cmx2 use the running daemon, or start one on loopback inside their own process if none is up, so the quickstart needs no setup step. docs/architecture.md names every package and walks one request through the system. here is one turn that spawns a helper:
prerequisites: macos or linux (arm64 or x64), ripgrep (rg) on your PATH, git, and an anthropic api key (google and openai-compatible endpoints work too, see the quickstart). to build from source you also need bun 1.3.14.
curl -fsSL https://raw.githubusercontent.com/clauseo-ai/cmx2/main/scripts/install.sh | shno release is tagged yet, so that fails today. until the first release, build from source (below).
export ANTHROPIC_API_KEY=sk-ant-...
cmx2 doctor # checks the machine, names a fix for each problem
cmx2 serve --install # keep the daemon running as a login service
cmx2 pair # prints a url and a one-time token for a clientgive that url and token to boxbox, the web client, and you can drive your sessions from a browser or a phone. boxbox is a web app plus a rust server. the server pairs with your daemon, and the app talks to the server. for one-off prompts with no client at all:
cd path/to/a/repo
cmx2 run "explain this repo in three lines" # headless: prints the answer and exitscmx2 on its own opens a terminal client.
once a release exists, the installer downloads the binary for your machine from the latest release and checks it against the release's SHA256SUMS. it puts it in ~/.local/bin/cmx2.
from source (cmx2 upgrade only works on release binaries, a source build has no repository stamped into it):
git clone https://github.com/clauseo-ai/cmx2 && cd cmx2
bun install
bun scripts/build.ts # writes dist/cmx2
bun run dev # or run the daemon straight from source on 127.0.0.1:4830| command | what it does |
|---|---|
cmx2 doctor |
what is wrong on this machine, in plain words |
cmx2 serve --install |
keep the daemon running as a login service (launchd on macos, systemd on linux) |
cmx2 pair |
print a url and a one-time token for a client such as boxbox |
cmx2 run "<prompt>" |
one prompt, headless. --session <id> continues an earlier session |
cmx2 session list |
what you have done so far |
cmx2 models |
the models this machine can run |
cmx2 upgrade |
fetch the latest release and swap the binary. release binaries only |
cmx2 |
open a terminal client in the current directory |
cmx2 --help lists every command. config lives in ~/.config/cmx2/cmx2.jsonc and sessions in ~/.local/share/cmx2/. examples/ has sample config: another provider, a routing table, a permission preset and service files.
web search works with no setup through tavily's free keyless mode, which is rate limited. for more, get a free tavily key (1,000 credits a month, no card) at app.tavily.com and export TAVILY_API_KEY=.... exa, brave and a self-hosted searxng work too: see web search.
- docs/quickstart.md: install, pick a model, a first session, a service and pairing.
- docs/architecture.md: the packages, the daemon and one request end to end.
- docs/tui.md: the terminal client's keys and theme.
- docs/permissions.md: what a session may do without asking, and how rules read.
- docs/agents.md: spawning helper agents, parked agents, reports and caps.
- docs/routing.md: the table of models a helper can run on, and how the model picks one.
- docs/engineering/: design docs for contributors.
- CONTRIBUTING.md, SECURITY.md, CHANGELOG.md.
the daemon's http contract is packages/client/openapi.json. both it and the typed client @cmx2/client in packages/client are generated from packages/contract/src/manifest.ts. @cmx2/client is a workspace package you use from a checkout. it is not published to npm.
GET /global/system says what machine a daemon runs on (os name and version, model, cpu) and how it is doing (load, memory, the data volume's disk space, host and daemon uptime). it needs the same credential as every other route and is cheap enough to poll: the static fields are read once, the live ones without starting a process.
- boxbox: the web client for cmx2 (a progressive web app for phone, tablet and desktop) plus a rust server. the server pairs with each daemon using
cmx2 pair, and the app talks to the server. - cmx: the predecessor, a runtime built on a fork of opencode. cmx2 can import its history:
cmx2 db import-cmxcopies it in read-only, for browsing. - pi: the agent library cmx2 runs on.
MIT. third-party code and its licenses are listed in THIRD_PARTY.md.