Xiaomi open-sourced MiMo Code under MIT on 2026-06-10: a terminal coding agent built on OpenCode, aimed at tasks that run for hundreds of steps. In its own double-blind test, 1,213 paired runs across 576 developers and 474 repositories, the win rate against Claude Code sat near 50% below 200 steps and rose above 65% past it. The article explains that gap with three time scales: computation inside a turn, memory across turns, evolution across sessions.

Drawn out, each time scale is a small state machine, and in each one the runtime takes a decision away from the model doing the work: the judge takes the plan choice, the verifier takes the stopping call, the writer takes the memory, and two maintenance agents take the pruning.

Computation: one turn, four exits

Max Mode samples five plans in parallel at temperature 1 and never executes them; the same model judges the plans and one gets to run. That buys 10-20% on SWE-Bench Pro for four to five times the tokens. The Goal verifier is the cheaper lever and the one that decides how a turn ends: a separate call with the same conversation and the real tool outputs, no part in the work, so it has no interest in agreeing that the task is finished.

Turn states and the four exits The turn runs from assembled input through five sampled plans and a judge to execution. Each exit attempt goes to an independent verifier that either returns a gap, passes the task, marks it impossible, or the loop cap exits automatically. FIGURE 1 TURN STATES, FOUR EXITS Turn Input window + files 5 Candidates plan only, T=1 Judge picks one plan Execute tool calls run next turn Goal Check same context, no work exit attempt Continue gap fed back Done condition met Impossible marked, not looped Cap Exit loop under 0.5%

Every exit but one costs a verifier call, and the exception is a counter in the runtime, not a judgement. The verifier is the only state in the graph that can refuse the agent’s answer, which is why it holds the same context and none of the work. Two further compute levers do not change the graph: the constrained command syntax is design intent, not migrated, and Dynamic Workflow moves orchestration out of the prompt into a sandboxed script whose results land on disk after every agent() call.

Memory: the window is a disposable unit

Checkpoints fire at roughly 20, 45 and 70% of the budget, not at 95%. Extraction needs room to read, hold an interpretation and write, and the middle of a long context is where attention is weakest, so the compression cannot be scheduled for the moment the window is nearly gone. The main agent does not maintain its own state: a separate writer does it, and the only thing the main agent may write is notes.md, which the writer drains at each checkpoint. Underneath the structured files sits the raw SQLite trace, the fallback when a detail was dropped rather than compressed.

Window lifecycle and memory layers A window moves from working to a checkpoint, written by a separate writer into session memory, then continues until a rebuild opens the next window seeded from the files. Session memory is promoted to project memory, then global memory, with the raw history below as the fallback. FIGURE 2 WINDOW LIFECYCLE AND MEMORY LAYERS Working turns accumulate Checkpoint at 20 / 45 / 70% Rebuild cuts the window Next Window seeded from files Writer separate subagent Session checkpoint.md Project MEMORY.md Global user preferences History SQLite trace a cycle: checkpointed turns ending in one rebuild, no upper bound on cycles

Everything else in this figure follows from one split: the writer never has to solve the task. The percentages, the eleven fields and the 65K rebuild budget are tuning around that split, not independent ideas. It also fixes the failure mode: the agent debugging a bad test cannot quietly downgrade the record of what it was asked to do.

Evolution: two clocks, two outputs

Dream runs every 7 days over the sessions and the existing memory file: merge, deduplicate, check that referenced paths still exist, keep what is current. Distill runs every 30 days over the same history but looks for process instead of knowledge, and writes what it finds into skills, CLI commands, custom agents and SOP documents.

Two maintenance clocks Session history feeds both maintenance agents. Dream runs every seven days and produces a compacted memory file. Distill runs every thirty days and produces reusable artifacts. FIGURE 3 TWO MAINTENANCE CLOCKS History raw sessions Dream every 7 days Memory merged, path-checked Distill every 30 days Artifacts skills, CLI, SOP

The two outputs are not interchangeable. Dream shrinks what the agent has to read at the start of a session, so it buys back context. Distill removes a step the agent would otherwise reason through, so it saves tokens on a repeated task. Only the second one compounds without needing a bigger window.

The price is five extra model roles outside the task: judge, verifier, writer, dream, distill. The article reports no ablation that isolates any of them, and its offline benchmarks measure one issue at a time, so nothing in the published numbers measures the mechanisms that only fire past 200 steps. Whether five roles stay separate, or collapse into one runtime-owned maintenance process, is the part still open.

MiMo Code: Scaling Coding Agents to Long-Horizon Tasks