MiMoCode is a free & open-source AI coding agent from Xiaomi’s MiMo team, built for long-horizon automated programming tasks that span dozens of execution steps and multiple sessions.
The default model channel, MiMo Auto, runs MiMo-V2.5 with a one-million-token context window and needs no account or API key to get started.
MiMo Auto is now free for a limited period.
A coding agent’s value in a long-running project depends less on a single smart response and more on whether it remembers architectural decisions, active tasks, and past fixes when you return hours or days later.
MiMoCode stores that state in layered checkpoint files, project-level memory, and a full-text searchable history.
A background writer subagent updates those records at low context utilization, and a rebuild process reconstructs the context when the model window fills.
The result is a logical session that can span days and hundreds of steps without losing track of what you were building.
Features
- 3 agents: build (full tool permissions for active development), plan (read-only analysis for code exploration and solution design), and compose (orchestration for specs-driven work from idea to shipped code).
- Saves session state automatically at roughly 20%, 45%, and 70% of the configured context budget through an independent checkpoint writer subagent that operates outside the main agent’s attention and token budget.
- Rebuilds working context from checkpoint, project memory, task progress logs, and recent user messages when the physical context window approaches its limit. Total injected content at rebuild stays within approximately 65K tokens.
- 4 memory layers: session checkpoints (current session only, in
checkpoint.md), project knowledge inMEMORY.md(persistent across sessions), global user preferences (across all projects), and a full SQLite history trace for raw message lookup. - Runs
/dreamevery 7 days: an independent agent reads historical sessions and the existing memory file, then merges, deduplicates, verifies file paths, and compresses scattered memories into a current-state representation. - Runs
/distillevery 30 days: reads historical sessions and extracts recurring work patterns into reusable skills, CLI commands, custom agents, and SOP documents. - Supports Max Mode (experimental): generates five parallel candidate responses per turn, evaluates all with the same model acting as a judge, and executes the best plan.
- Sets a stop condition with
/goal. When the agent attempts to end the session, an independent judge model reviews the full conversation and confirms the condition is met. If not, the judge feeds the specific gap back to the agent. - Creates subagents on demand, with shared session context, parallel execution, lifecycle tracking, and background execution.
- Accepts real-time voice input with MiMo ASR, segmented by pauses and transcribed incrementally. Requires a Xiaomi MiMo account login.
- Connects to any OpenAI-compatible API provider through the TUI setup or the config file.
- Imports Claude Code authentication in one step during first-launch setup.
- Configures MCP server connections, custom agents, custom commands, skills, keybindings, themes, LSP integration, and custom tools.
MiMo Code vs Claude Code
MiMo Code is the better choice when open-source control, custom model providers, and file-based long-session memory matter most.
Claude Code is the better choice when you need a mature commercial coding stack with wider platform coverage, GitHub automation, IDE workflows, and a supported Agent SDK.
| MiMo Code | Claude Code | |
|---|---|---|
| Source | Open source, MIT. | Commercial. |
| Best for | Provider control. | Team workflows. |
| Setup | MiMo Auto or API. | Claude account or API. |
| Models | MiMo plus custom providers. | Claude-first. |
| Memory | Files, checkpoints, SQLite. | CLAUDE.md, memory, skills. |
| Long tasks | Context rebuilds. | Compaction and checkpoints. |
| Agents | Build, plan, compose. | Subagents and skills. |
| Automation | Compose workflows. | GitHub, hooks, SDK. |
| Completion | /goal judge. | Workflow controls. |
| Learning | /dream, /distill. | Memory and skills. |
| GitHub | Terminal Git work. | Native GitHub workflows. |
| Security | Needs external isolation. | Managed permissions. |
| Cost | Free limited MiMo Auto. | Claude plan or API. |
Get Started with MiMoCode
Install MiMoCode:
curl -fsSL https://mimo.xiaomi.com/install | bashOr install via npm:
npm install -g @mimo-ai/cliOn first launch, MiMoCode presents four model access options: MiMo Auto (no login, no API key, free for a limited period), Xiaomi MiMo platform login, import from an existing Claude Code authentication config, or a custom OpenAI-compatible API provider configured through the TUI.
After setup, launch MiMoCode from your project directory:
mimocodeThe build agent is active by default. Press Tab to switch to plan for read-only analysis or to compose for specs-driven orchestration.
Set a stopping condition before an autonomous long-form run:
/goal all tests pass and the feature branch is committedRun memory maintenance after a long session or project phase:
/dreamExtract recurring workflows into reusable skills:
/distillActivate voice input (requires MiMo login):
/voiceAdd this entry to .mimocode/mimocode.json to enable Max Mode:
{
"experimental": {
"maxMode": true
}
}MiMoCode Cheat Sheet & Quick Reference
Table Of Contents
CLI Commands and Flags
| Command | Key Flags |
|---|---|
mimo [project] | --continue, -c, --session, -s, --fork, --prompt, --model, -m, --agent, --port, --hostname. |
mimo attach [url] | --dir, --session, -s. |
mimo github run | --event, --token. |
mimo models [provider] | --refresh, --verbose. |
mimo run [message..] | --command, --continue, -c, --session, -s, --fork, --share, --model, -m, --agent, --file, -f, --format, --title, --attach, --port, --dangerously-skip-permissions. |
mimo serve | --port, --hostname, --mdns, --cors. |
mimo session list | --max-count, -n, --format. |
mimo stats | --days, --tools, --models, --project. |
mimo web | --port, --hostname, --mdns, --cors. |
mimo acp | --cwd, --port, --hostname. |
mimo uninstall | --keep-config, -c, --keep-data, -d, --dry-run, --force, -f. |
mimo upgrade [target] | --method, -m. |
| Global flags | --help, -h, --version, -v, --print-logs, --log-level. |
Subcommands
| Command | Action |
|---|---|
mimo auth [command] | Manage provider credentials and login. |
mimo auth login | Configure API keys for model providers. |
mimo auth list | List authenticated providers. |
mimo auth ls | Short form of mimo auth list. |
mimo auth logout | Remove a provider from the credentials file. |
mimo mcp [command] | Manage Model Context Protocol servers. |
mimo mcp add | Add a local or remote MCP server. |
mimo mcp list | List configured MCP servers and connection status. |
mimo mcp ls | Short form of mimo mcp list. |
mimo mcp auth [name] | Authenticate with an OAuth-enabled MCP server. |
mimo mcp auth list | List OAuth-capable MCP servers and authentication status. |
mimo mcp auth ls | Short form of mimo mcp auth list. |
mimo mcp logout [name] | Remove OAuth credentials for an MCP server. |
mimo mcp debug <name> | Debug OAuth connection issues for an MCP server. |
mimo session [command] | Manage MiMo Code sessions. |
mimo session list | List MiMo Code sessions. |
Slash Commands
| Command | Action |
|---|---|
/connect | Add a model provider and API key. |
/compact | Compact the current session. |
/summarize | Alias for /compact. |
/details | Toggle tool execution details. |
/editor | Open an external editor through the EDITOR environment variable. |
/exit | Exit MiMo Code. |
/quit | Alias for /exit. |
/q | Alias for /exit. |
/export | Export the current conversation to Markdown and open it in the default editor. |
/help | Show the help dialog. |
/init | Create or update AGENTS.md. |
/models | List available models. |
/new | Start a new session. |
/clear | Alias for /new. |
/redo | Restore a previously undone message and file changes. |
/sessions | List and switch between sessions. |
/resume | Alias for /sessions. |
/continue | Alias for /sessions. |
/share | Share the current session. |
/themes | List available themes. |
/thinking | Toggle reasoning-block visibility in the conversation. |
/undo | Remove the last message and revert file changes through Git. |
/unshare | Stop sharing the current session. |
/goal | Set a natural-language stopping condition for the session. |
/voice | Start real-time streaming voice input for logged-in MiMo users. |
/dream | Scan recent session traces, extract persistent project knowledge, and remove outdated memory entries. |
/distill | Find repeated manual workflows and package high-confidence patterns into reusable skills, subagents, or commands. |
Built-in Agents
| Agent | Role |
|---|---|
build | Default primary agent with full tool access. |
plan | Read-only analysis and planning agent. |
compose | Workflow-driven primary agent with built-in skills. |
general | Subagent invoked by primary agents. |
explore | Subagent invoked by primary agents. |
Compose Skills
| Skill | Purpose |
|---|---|
compose:tdd | Test-driven development workflow. |
compose:debug | Systematic debugging. |
compose:verify | Completion verification. |
compose:brainstorm | Feature brainstorming. |
compose:plan | Implementation planning. |
compose:execute | Approved plan execution. |
compose:parallel | Parallel agent dispatch. |
compose:review | Code review request. |
compose:feedback | Review feedback handling. |
compose:worktree | Git worktree workflow. |
compose:merge | Development branch merge. |
compose:subagent | Subagent-driven development. |
compose:new-skill | New skill authoring. |
Core Config Fields
.mimocode/mimocode.jsonProject-level configuration~/.config/mimocode/mimocode.jsonGlobal configuration
| Field | Use |
|---|---|
$schema | JSON Schema URL for editor completion and validation. |
model | Default primary model in provider_id/model_id format. |
small_model | Lightweight-task model. |
provider | Provider connection and runtime options. |
disabled_providers | Disabled provider IDs. |
enabled_providers | Provider allowlist. |
agent | Custom agent definitions. |
default_agent | Default agent. |
command | Custom command templates. |
permission | Permission rules for tool actions. |
tool | Tool invocation style. |
mcp | MCP server definitions. |
plugin | Plugin package or local path list. |
skills | Skill load sources. |
lsp | Language Server Protocol integration. |
formatter | Code formatter settings. |
instructions | Instruction file paths or globs. |
share | Session sharing mode: manual, auto, or disabled. |
autoupdate | Auto-update behavior. |
compaction | Context compaction policy. |
checkpoint | Checkpoint thresholds and quotas. |
snapshot | Snapshot switch. |
watcher | File watcher ignore rules. |
server | mimo serve and mimo web settings. |
enterprise | Enterprise URL configuration. |
username | Custom username. |
logLevel | Runtime log level. |
experimental | Experimental features. |
Environment Variables
| Variable | Use |
|---|---|
MIMOCODE_HOME | Single profile root for config, data, state, and cache. |
MIMOCODE_CONFIG | Custom config file path. |
MIMOCODE_CONFIG_DIR | Custom config directory. |
MIMOCODE_CONFIG_CONTENT | Inline JSON config content. |
MIMOCODE_TUI_CONFIG | Custom TUI config path. |
MIMOCODE_PERMISSION | Inline JSON permission config. |
MIMOCODE_DB | Database file path override. |
MIMOCODE_MODELS_URL | Custom model manifest fetch URL. |
MIMOCODE_MODELS_PATH | Custom model manifest local path. |
MIMOCODE_GIT_BASH_PATH | Git Bash executable path on Windows. |
MIMOCODE_PURE | Pure runtime mode. |
MIMOCODE_AUTO_SHARE | Automatic session sharing. |
MIMOCODE_DISABLE_SHARE | Full session-sharing disable switch. |
MIMOCODE_DISABLE_AUTOUPDATE | Auto-update check switch. |
MIMOCODE_ALWAYS_NOTIFY_UPDATE | New-version notification switch. |
MIMOCODE_DISABLE_AUTOCOMPACT | Automatic context compaction switch. |
MIMOCODE_DISABLE_PRUNE | Old-data pruning switch. |
MIMOCODE_DISABLE_TERMINAL_TITLE | Terminal title update switch. |
MIMOCODE_DISABLE_MOUSE | TUI mouse capture switch. |
MIMOCODE_DISABLE_DEFAULT_PLUGINS | Default plugin switch. |
MIMOCODE_DISABLE_LSP_DOWNLOAD | LSP auto-download switch. |
Alternatives and Related Resources
- 7 Best CLI AI Coding Agents in 2026: Compare MiMoCode against the world’s best open-source coding agents.
- Kimi Code CLI: Free, open-source terminal coding agent from Moonshot AI with skills and MCP support.
- Pi Coding Agent: Supports 15+ AI providers and TypeScript extensions for full agent customization.
- CodeWhale: Free, open-source Claude Code alternative powered by DeepSeek.
- OpenClaude: Terminal coding agent supporting OpenAI, Gemini, GitHub Models, Codex, and Ollama.
Pros
- MIT-licensed source code.
- Terminal-native workflow.
- Cross-session memory.
- Built-in planning mode.
- Compose skill system.
- MCP server connections.
- Custom provider support.
- Experimental Max Mode.
Cons
- MiMo Auto is temporary.
- API setup requires billing.
- No security sandbox.
- Max Mode costs more tokens.
FAQs
Q: Does MiMoCode require a signup or login?
A: No signup is required to use MiMo Auto. A Xiaomi MiMo account login unlocks voice input and the full platform experience. You can also use any OpenAI-compatible API key without a Xiaomi account.
Q: How is MiMoCode different from Claude Code?
A: Both are terminal-native AI coding agents with similar core tool capabilities. MiMoCode adds a persistent memory architecture with automatic session checkpointing, an independent writer subagent for state extraction, a task tree system, and cross-session knowledge distillation through /dream and /distill. The Xiaomi MiMo team’s double-blind developer trial reported a win rate above 65% over Claude Code on tasks exceeding 200 execution steps. On tasks under 200 steps, win rates ran close to 50% on both sides.
Q: What is Max Mode and when should I use it?
A: Max Mode generates five parallel candidate responses per turn, evaluates them with the same model acting as a judge, and executes the best plan. It improves SWE-Bench Pro scores by 10-20% but increases token consumption by roughly 4-5x. Enable it for high-stakes complex tasks where decision quality per step matters more than token cost. Keep it off for routine coding work. Enable via experimental.maxMode: true in .mimocode/mimocode.json.
Q: How does MiMoCode handle context limits in long sessions?
A: An independent checkpoint writer subagent saves a structured state file at roughly 20%, 45%, and 70% of the configured context budget. When the context window approaches its limit, the runtime opens a new window and rebuilds context from the checkpoint, project memory, task progress logs, and recent user messages. Total injected content stays within approximately 65K tokens. The main agent continues from that rebuilt state.










