Vibeleaderboard
← All Intel
Intel / article

Xiaomi open-sources MiMo Code, a long-horizon terminal coding agent

Source
mimo.xiaomi.com
Publisher
Xiaomi
Author
Xiaomi MiMo
Date

Context

Xiaomi's MiMo team built MiMo Code, an MIT-licensed terminal forked from OpenCode, around one problem: keeping an agent useful across dozens or hundreds of steps. The model itself is stateless, the team explains in its design write-up, so all continuity comes from the program that feeds it each turn. Passing back the full conversation works for tasks under 10 turns. Longer runs eventually fill the , and even before that, the model follows instructions less reliably as tool output piles up and buries the user's constraints.

What the launch post calls "Infinite Context" is, in the blog's account, a note-taking system the working agent does not run. At checkpoints set at roughly 20%, 45% and 70% of the configured context budget, a separate writer subagent reads the conversation and saves an 11-field state file covering the current intent, next action, constraints, task tree, files involved, and errors and fixes. The team triggers these early on purpose, arguing that a model extracts structure less reliably when its window is nearly full. When the window approaches its limit, the program opens a new one seeded from those files plus a verbatim slice of recent user messages, capped at about 65K tokens, so the agent continues without re-reading files it already handled. Knowledge that holds up across several checkpoints is promoted to a project MEMORY.md file that users can inspect and correct, and the full SQLite record of every session stays available for details the summaries dropped.

Two other features spend extra model calls to avoid mistakes. With Goal, the user sets a stopping condition in plain language, such as all tests passing and the code committed, and each time the agent tries to stop, an independent model call reviews the whole history to check it; Xiaomi puts the chance of an endless loop below 0.5%. Max Mode, still experimental, has the model draft five candidate next steps and pick one, which the team says improves Pro results by 10 to 20% at about 4 to 5 times the tokens. The broader evidence is also Xiaomi's own: in a blind internal test, 576 developers compared MiMo Code with Claude Code running the same model across 474 private repositories, yielding 1,213 decided pairs. The two were close to even on tasks under 200 steps, while MiMo Code won more than 65% of those beyond 200 steps, the long runs its memory design targets. The blog also reports MiMo Code with MiMo-V2.5-Pro ahead of Claude Code with Claude Sonnet 4.6 on three standard benchmarks, while noting that those measure one-shot fixes to single repository issues rather than long sessions.

Terms in this piece · Glossary
  • Agent mode — A mode in which one agent can inspect, edit, run commands, and iterate toward an outcome.
  • Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
  • SWE-bench — The standard benchmark for AI coding agents: real GitHub issues from real repositories, scored by whether the agent's patch passes the project's own tests.
  • Model Context Protocol (MCP) — A published agreement for an AI application to discover what a separate program offers and ask it to run one of those offerings.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

Read the source mimo.xiaomi.com
More from Xiaomi MiMo
Recommended reads