MiMo Code is a terminal-based coding agent developed by Xiaomi's MiMo team and open-sourced under the MIT license. As a long-horizon coding agent, it is purpose-built for automated programming tasks that extend over dozens or even hundreds of execution steps. Its core value lies in maintaining decision quality and state continuity across extended sessions, addressing a fundamental limitation of traditional coding agents. The basic structure of a coding agent places a language model inside a runtime and calls it in a loop. For short tasks with fewer than ten turns, passing the full conversation history works well. However, as tasks lengthen, the context window becomes exhausted and the model's instruction-following ability declines. MiMo Code solves this not by better compression, but by an explicit storage-and-retrieval mechanism that writes information into persistent structures and recalls it on demand. Built on OpenCode, it serves developers needing reliable multi-turn automation without sacrificing context awareness.
The core problem MiMo Code solves is the decline in decision quality and state continuity as coding tasks grow in length. In long-horizon scenarios, the context window fills with tool outputs, code snippets, and error logs, forcing compression that weakens distant information. Additionally, the model's ability to follow instructions degrades as input lengthens, diluting useful constraints and intentions. These issues compound over time, leading to premature termination, directional drift, and repeated mistakes. For developers working on complex refactoring, debugging, or migration projects, these failures are costly and frustrating. MiMo Code's explicit memory architecture ensures that critical information is preserved and retrievable, allowing the agent to maintain focus and accuracy throughout the entire session.
The first major feature group is Computation, which scales single-turn reasoning reliability. Max Mode generates five candidate solutions in parallel at each turn, using the same model as a judge to select the best reasoning and action plan. This reduces decision errors and improves performance by 10–20% on SWE-Bench Pro compared to single sampling, at the cost of higher token consumption. Goal provides independent completion verification: the user defines a natural-language stopping condition, and when the agent attempts to terminate, a separate model call reviews the full history to confirm satisfaction. This prevents premature termination and false positives, with infinite loops occurring less than 0.5% of the time. Together, Max Mode and Goal address both doing the task correctly and finishing it completely.
The second major feature group is Memory, which maintains state continuity across multi-turn tasks. The runtime introduces cycles: checkpoints triggered at 20%, 45%, and 70% of the context budget, where an independent writer subagent extracts structured state files. When the window approaches its limit, a rebuild injects the persisted files into a new window, allowing the logical session to extend indefinitely. The writer maintains four layers: session memory (checkpoint.md), project memory (MEMORY.md), global memory, and a full SQLite history. The main agent has read-only access except for a free-form notes.md, which the writer routes into structured fields. This layered approach ensures that critical information is never lost and can be retrieved on demand.
admin
The third feature group is Evolution, which enables continuous improvement from experience. MiMo Code maintains a project-level memory file in Markdown format, persistently storing architectural decisions, user rules, and verified technical facts across sessions. To prevent decay, Dream automatically triggers every 7 days, performing merging, deduplication, path-validity verification, and compression. Distill triggers every 30 days, focusing on process by identifying recurring work patterns and solidifying them into reusable skills, CLI commands, and standard operating procedures. This ensures that the agent learns from past sessions, avoids repeating mistakes, and becomes more efficient over time.
The product works overall through three integrated themes: computation, memory, and evolution. The main loop places a language model in a runtime, calling it in a cycle with tool execution. During each turn, the agent uses computation techniques to improve reliability. At checkpoint intervals, the writer independently extracts state into layered memory files. When the context window fills, a rebuild injects the accumulated state into a new window. Across sessions, evolution distills experience into project memory and reusable skills. The system is designed so that the main agent does not maintain its own memory, allowing it to focus on coding while the runtime handles persistence and the writer handles extraction.
Concrete use cases include real-world development scenarios evaluated through a human double-blind A/B test. In tasks with fewer than 200 execution steps, MiMo Code and Claude Code had win rates near 50%. For tasks exceeding 200 steps, MiMo Code's win rate rose to over 65%, demonstrating its advantage in long-horizon automation. Developers used it for project migration between languages, where Dynamic Workflow orchestrated dozens of parallel work units with deterministic control. Another scenario involved debugging complex issues over many turns, where the checkpoint writer preserved state without distracting the main agent. These outcomes show that MiMo Code excels at maintaining coherence and reliability in extended, multi-step programming tasks.
MiMo Code targets developers, software engineers, and AI researchers who require automated coding assistance over long sessions. It is particularly suited for teams handling large-scale code refactoring, cross-language migration, or continuous integration tasks that span multiple interactions. The agent runs in a terminal environment and can be installed via a one-line curl command or npm. On first launch, users select a model access method: MiMo Auto (free for a limited time with a 1-million-token context), Xiaomi MiMo platform login, or custom configurations. As an open-source project under MIT, it invites community contribution and customization. In summary, MiMo Code empowers users with a long-horizon coding agent that maintains explicit memory for superior state continuity and decision quality across complex automation workflows.
MiMo Code is designed for software developers, engineers, and AI researchers who need automated coding assistance for long-horizon tasks. It serves professionals working on large-scale code refactoring, cross-language migration, debugging, and project maintenance that spans multiple sessions. The tool is particularly valuable for teams managing complex codebases where context preservation across many automation steps is critical. Open-source contributors and individual developers seeking a reliable, memory-enhanced coding agent will also benefit. The agent runs in a terminal environment, catering to command-line users who prefer minimal setup and direct control.