MiMo Code: Scaling Coding Agents to Long-Horizon Tasks

June 10, 2026 — MiMo Code is a terminal-based coding agent built by Xiaomi’s MiMo team on top of OpenCode and open-sourced under the MIT license. It is designed for long-horizon automated programming tasks, with a core focus on how to maintain decision quality and state continuity over dozens or even hundreds of execution steps.

Design Motivation

For short tasks (typically fewer than 10 turns), passing full conversation history works well. As task turns increase, two problems emerge: context window exhaustion and declining instruction-following as input length grows. Xiaomi argues the solution is not better compression but explicit storage-and-retrieval — deciding what to write into persistent structures and when to recall it.

MiMo Code is designed around three themes: computation (single-turn reasoning quality), memory (multi-turn state continuity), and evolution (cross-session improvement).

Computation Features

  • Max Mode: Generates N parallel candidate solutions per turn (default N=5); a judge model selects the best plan. Improves SWE-Bench Pro by 10–20% at ~4–5× token cost.
  • Goal: Independent verifier checks natural-language stopping conditions before the agent terminates, reducing premature “done” declarations.
  • Dynamic Workflow: Orchestration logic compiled to deterministic JavaScript executed in a sandbox, compatible with Anthropic Dynamic Workflow semantics.

Memory Architecture

Four layers backed by SQLite FTS5:

  1. Project memory (MEMORY.md) — persistent project knowledge
  2. Session checkpoints — structured state snapshots via checkpoint-writer subagent
  3. Scratch notes (notes.md)
  4. Task progress (tasks/*/progress.md)

The checkpoint-writer subagent runs concurrently with the main agent. Checkpoints trigger at ~20%, 45%, and 70% of context budget — not at the limit. When the window fills, the runtime rebuilds context from persisted files.

Evolution: Dream and Distill

  • /dream: Runs automatically every ~7 days; reviews historical sessions, deduplicates memories, verifies file paths, compresses into long-term memory.
  • Distill: Mines past sessions for repeated workflows and automates them.

Installation

curl -fsSL https://mimo.xiaomi.com/install | bash
npm install -g @mimo-ai/cli

On first launch, users choose: MiMo Auto (free limited-time, MiMo-V2.5, 1M token context), Xiaomi MiMo platform login, Claude Code config import, or custom OpenAI-compatible provider.

Benchmark Claims (Internal)

MiMo Code + MiMo-V2.5-Pro vs Claude Code + Claude Sonnet 4.6:

  • SWE-bench Verified: 82% vs 79%
  • SWE-bench Pro: 62% vs 55%
  • Terminal Bench 2: 73% vs 69%

Same-model harness comparison (MiMo-V2.5-Pro in both): +5 points on SWE-bench Pro and Terminal Bench 2 attributable to harness alone.

Human A/B evaluation: 576 developers, 474 private repos, 1,213 head-to-head pairs. Under 200 steps ~50/50; past 200 steps MiMo Code win rate above 65%.