Why muxcode?
A model can pass a physics exam and still break in a loop that nobody reads. muxcode puts code around the model, so each change is checked before it reaches you.
At a glance
- In a loop, nobody reads each step, so one step's slip becomes the next step's input.
- At 98% right per step, 42 steps in a row all come out right 43% of the time. A check after each step that catches 9 slips in 10 lifts that to 92%.
- muxcode's host runs your tests, type-check and lint and reads their exit codes. No model can argue a failed check away.
- Clef, Cloudflare's decision model, answers a typed question with a probability, and muxcode acts only at or above that question's bar.
A model that can pass a physics exam can still break your build. Ask it for JSON inside a loop, and some day it sends back text that only looks like JSON. Nobody reads that step, so the next step trusts it.
A bigger model slips less often. It still slips, and in a long run “less often” is not enough.
muxcode is the app we built for that gap. It runs a coding agent on your Mac and puts code around the models. Every tool call passes a gate, and every change passes your checks before the next step builds on it. This post says why, and what muxcode is and is not.
A chat has a reader. A loop has none.
Chat models are trained to write replies people like. That suits a chat: you read the reply, see the slip and say so.
A coding agent has no one at each step. It runs a tool, reads what came back and runs the next one. One step’s slip is the next step’s input.
A chat You are there
- You ask A question or a task
- The model replies Text that reads well
- You read it You spot the slip and say so
Works A person is the check.
A bare loop Nobody is there
- Step 1 The model acts
- Step 2 Builds on a slip nobody saw
- Step 3 Builds on step 2
Breaks No one reads step 1, so the slip rides along.
muxcode Code is there
- The model acts Inside a written contract
- The host checks Your tests and the exit code
- Pass or send back A fail goes to a second model, with the reason
Works Code checks each change before the next step builds on it.
Small slips add up
Say each step is right 98 times in 100, and each slip is independent. The chance that all 42 steps in a row are right is 43%. For 100 steps it is 13%. Yann LeCun has made a version of this case against models that write one token at a time.
Real slips are not independent, and a later step sometimes repairs an earlier one. So read the no-check line as a sketch of the effect, not a forecast.
- No check, 98% right per step
- 43% after 42 steps, 13% after 100
- A check that catches 9 slips in 10
- 92% after 42 steps, 82% after 100
The way out is to catch the slip at the step where it happens, before the next step builds on it.
A check is an exit code
In muxcode, a check means your tests, your type-check and your lint, run by the host: the code muxcode runs around the models. The host reads their exit codes.
A check that passed on the untouched project and fails twice after the change fails the change. Nothing a model says can argue it away.
Clef, the classifier the next section covers, can add a failure the exit codes miss, such as a test script rewritten to check less. It can never remove one.
A wrong answer that sounds sure
A model tuned on what people prefer learns to sound sure, because sure answers get liked. In a chat, a wrong but sure reply costs you a second read. In a pipeline, it corrupts data and makes no noise.
Software needs something else from a model: an answer, and how sure it is. Then the software can act on the answers that are sure and leave the rest.
That is the job of Clef, the classifier muxcode runs alongside its models. Clef is Cloudflare’s 27B decision model, run as @cf/cloudflare/clef on Workers AI: small next to a chat model, fast, and built to answer a typed question with a choice and a probability, not a paragraph.
A question is a yes or no, a pick from a list, or a score on a scale. Is this contract missing a check? Is this logic, UI or terminal work? How hard is this change, from 0 to 4? muxcode compares each answer with a fixed bar for that question.
Why a probability and not a yes
We don’t claim Clef is more accurate than a chat model; we have not measured that. What we can show is how muxcode decides when to trust an answer, in five steps.
- Clef answers with a probability, not prose. It reads a typed question and returns a probability for every allowed answer in a single forward pass, with no text to write (model card). Cloudflare’s launch post, on 1 October 2026, says its post-training paired cross-entropy with a Brier loss to refine probability calibration.
- Each question has a bar in code. Because the answer is a number, muxcode can hold it to a fixed threshold. Every threshold is registered in one place,
intake::threshold_for, and every answer is logged with the model that gave it. - Each bar is checked against labelled cases. We report precision and recall with 95% intervals against one rule: at least 90% of at least three sure answers right, and at least half the true cases caught. Not every shipped bar meets it on Clef yet: three catch too few true cases, though every sure answer they gave was right. The lane’s bars were frozen before a 30-case holdout was written to test them. On that holdout, a check proves the change was right 15 of 15 times when sure, confined 14 of 14 and subtle 6 of 6; no change went solo by mistake, and 9 of 10 true solo changes did. On the full calibration set, all answered by Clef, 16 of 19 question groups met the bar at the shipped cuts; Clef Flash met it on 10.
- A chat model’s yes is just a yes. It has no probability to hold to a bar, and models that state their own confidence tend to overstate it (Xiong et al., ICLR 2024). When Clef is off, a low-stakes question may fall back to the chat model you name, but muxcode withholds every action that yes would take: staging by instruction, for one, reports the pick only as a suggestion. A high-stakes question gets Clef or nothing.
- Code goes first. Exit codes, the same checks run before and after a change, and risk flags such as a touched manifest are settled by code. Clef reads only what code cannot.
The evidence files are in muxcode’s docs/benchmarks/2026-10-19-clef/: the frozen cuts in lane-threshold-selection.json, the holdout in lane.holdout.cases.json and lane.holdout.results.json, and the full set in all-hooks.clef.calibration.json.
What muxcode is, and what it is not
The words are close, so here they are side by side.
-
A chat assistant
- What it is
- A model you talk to
- What it gives back
- Text for you to read
- Who checks it
- You
- When it is unsure
- It often sounds sure anyway
-
A decision model
- What it is
- A small model that answers typed questions
- What it gives back
- A choice and a probability
- Who checks it
- The code that asked
- When it is unsure
- It says so in its number
-
muxcode
- What it is
- The app on your Mac that runs a coding agent
- What it gives back
- A checked change, waiting on a branch
- Who checks it
- The host, with exit codes, then a judge
- When it is unsure
- It asks you, or keeps what you set
muxcode is not a new kind of model, and it does not swap chat models for decision models. Code is text, so chat models still write it. The seats are filled by the models you already sign in to, such as Claude and GPT, and on a paid plan by the one mux includes. A seat is a role with its own model, like the Architect, the worker and the retry.
What muxcode adds is what a chat leaves to you: the plan, the check, the second opinion and the permission.
Writes
The models
The chat models you sign in to, in seats: Architect, worker, retry.
- Gives back
- Text and code
- Cannot
- Pass its own work
Decides
The host
muxcode's own code, on your Mac. It has no opinions, only rules.
- Gives back
- Exit codes, and yes, ask or no
- Cannot
- Write your code
Reads
Clef
Cloudflare's decision model, on Workers AI. A small classifier that reads along.
- Gives back
- A typed answer and a probability
- Cannot
- Hold a seat or widen a permission
Five things that split gives you
- Every change starts with a plan. The Architect writes a contract first: the change, what it must not touch, and the checks that prove it. Each later step is held to it.
- Code settles what code can. The gate runs the checks and reads the exit codes before any judge sees the change.
- A reject gets a fresh attempt. A rejected change goes to the retry seat with the judge’s points named; in the shipped workflow that is the worker’s model at a higher reasoning level. The judge reads the finished change in a session of its own, and a change whose mistakes would pass the tests also needs a second reviewer on another model.
- Every tool call passes the gate. The agent asks, and the gate on your Mac answers by your permission mode and the rules you keep. Reads pass without a card, and an edit inside a
.gitfolder always asks, except in bypass mode. - The models are yours. mux serves one, the DeepSeek V4.1 Flash that Pro and Pro+ include; the other seats come from your own sign-ins, and on a paid plan a seat you have not signed in for runs on DeepSeek until you do. Change a seat’s model and the task, its history and your rules stay where they were.
Cowork’s issue workflow runs every seat, the judge too, on mux’s included model, and a test that fails on today’s code and passes after the change is the check.
Read how muxcode works to follow one change through all five.
The working where each number comes from
- 43% and 13%: 0.98 to the power 42 is 0.428, and to the power 100 is 0.133. The 98% is a round figure to show the effect, not a measured rate for any model.
- The check line: a check that catches 9 slips in 10 gives 0.98 + 0.02 × 0.9 = 0.998 per step. That is 92% after 42 steps and 82% after 100. It is our assumption, not a measurement.
- 0.92 to 0.98, and 0.23 to 0.79: the ranges of Jev’s level answers in the first live run with the shipped workflow, filed 2026-09-24 (4 readings), and in the QA run of 2026-09-23 on a test workflow (8 answers). Both are from effort, one generation at a time. The example answers above the scale are drawn to match them.
- 17 of about 65: from the same post; we did not keep the QA log.
- 471 ms over 441 answers: the median of muxcode’s calibration run on Clef for 1.0.12,
all-hooks.clef.calibration.json, read on 2026-10-19, from a case for a custom harness. - Bars, logging and the shipping rule:
intake::threshold_for,judgements.modelandwithhold_uncalibratedin muxcode 1.0.12’sworkflow/intake.rs, and the precision and recall rule in its calibration scorer, commit 844068b0, read on 2026-10-19. - 15 of 15, 14 of 14, 6 of 6, 9 of 10: the lane holdout. Its cuts were frozen in muxcode commit 23988df2 and the 30 cases written after, in 57c9a01d; the people who wrote the questions wrote the cases.
- 16 of 19 and 10 of 19: question groups meeting the bar on muxcode’s full calibration set, Clef against Clef Flash, from muxcode 1.0.12’s changelog.
- Brier loss, single forward pass, 27B: Cloudflare’s launch post of 2026-10-01 and the Clef model card, read on 2026-10-19. The training claim is Cloudflare’s; we have not checked it.
- 0.85: the bar an effort level had to meet, from How Clef works on 2026-10-07, where a bar is the least confidence at which muxcode acts. muxcode 1.0.12 removed the effort question on 2026-10-19.
- The included model and Cowork’s roster: muxcode’s
CHANGELOG/1.077.md(1.0.13), and the shipped default and issue workflows in muxcode 1.0.19’sorchestration.rs, read on 2026-10-28. - Three kinds of question: a yes or no, a pick from a list and a score, the three answer types muxcode asks Clef for, read from muxcode’s code on 2026-10-07. Whether a contract is missing a check is a yes or no, the kind of change is a pick (until 2026-10-19 the example was the worker), and how hard a change is is a score from 0 to 4.