All posts

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

  1. You ask A question or a task
  2. The model replies Text that reads well
  3. You read it You spot the slip and say so

Works A person is the check.

A bare loop Nobody is there

  1. Step 1 The model acts
  2. Step 2 Builds on a slip nobody saw
  3. Step 3 Builds on step 2

Breaks No one reads step 1, so the slip rides along.

muxcode Code is there

  1. The model acts Inside a written contract
  2. The host checks Your tests and the exit code
  3. 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.

The model is the same in all three rows. What changes is who checks its work 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.

Chance that every step is right. With no check it falls to 43% at 42 steps and 13% at 100. With a check after each step it is 92% at 42 and 82% at 100. 0% 25% 50% 75% 100% 0 20 40 60 80 100 Steps in a row Chance every step is right No check 43% 13% A check after each step 92% 82% Chance that every step is right. With no check it falls to 43% at 42 steps and 13% at 100. With a check after each step it is 92% at 42 and 82% at 100. 0% 25% 50% 75% 100% 0 50 100 Steps in a row Chance every step is right No check 43% 13% With a check 92% 82%
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
With no check, 42 steps in a row come out right 43% of the time; with a check after each step, 92%. A sketch, not a measurement: it assumes each step slips on its own, which real work does not.

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.

The question has a type

  • yes or no: is this contract missing a check?
  • pick one: is this logic, UI or terminal work?
  • a score: how hard is this change, 0 to 4?

Asked which effort level fitted, it answered with a choice and a number

An answer over the bar

level
medium
confidence
0.92

Acts

An answer under the bar

level
high
confidence
0.61

Changes nothing

muxcode holds it to the bar for that question

  • QA, 8 answers, 0.23 to 0.79: none over the bar
  • First live run, 4 readings, 0.92 to 0.98: all over
muxcode acts on an answer only at or above the bar for that question. Below it, or with no answer, the run carries on as it would without Clef. The bands are Jev's answers, the classifier before Clef, to an effort question muxcode 1.0.12 no longer asks.

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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
A chat assistant gives you text to check. A decision model gives code a number to check. muxcode is the code that does the checking, so what reaches you is a checked change.

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
A model can ask for anything. Only the host, or you on its card, can say yes.

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 .git folder 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.model and withhold_uncalibrated in muxcode 1.0.12’s workflow/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’s orchestration.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.