MiMo Code: Open-Source AI Coding Agent with Cross-Session Memory

Free to start with no API key. MiMo Auto runs MiMo-V2.5 at 1M-token context, with automatic checkpointing, cross-session project memory, and open-source code under MIT.

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 in MEMORY.md (persistent across sessions), global user preferences (across all projects), and a full SQLite history trace for raw message lookup.
  • Runs /dream every 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 /distill every 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 CodeClaude Code
SourceOpen source, MIT.Commercial.
Best forProvider control.Team workflows.
SetupMiMo Auto or API.Claude account or API.
ModelsMiMo plus custom providers.Claude-first.
MemoryFiles, checkpoints, SQLite.CLAUDE.md, memory, skills.
Long tasksContext rebuilds.Compaction and checkpoints.
AgentsBuild, plan, compose.Subagents and skills.
AutomationCompose workflows.GitHub, hooks, SDK.
Completion/goal judge.Workflow controls.
Learning/dream, /distill.Memory and skills.
GitHubTerminal Git work.Native GitHub workflows.
SecurityNeeds external isolation.Managed permissions.
CostFree limited MiMo Auto.Claude plan or API.

Get Started with MiMoCode

Install MiMoCode:

curl -fsSL https://mimo.xiaomi.com/install | bash

Or install via npm:

npm install -g @mimo-ai/cli

On 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:

mimocode

The 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 committed

Run memory maintenance after a long session or project phase:

/dream

Extract recurring workflows into reusable skills:

/distill

Activate voice input (requires MiMo login):

/voice

Add this entry to .mimocode/mimocode.json to enable Max Mode:

{
  "experimental": {
    "maxMode": true
  }
}

MiMoCode Cheat Sheet & Quick Reference

CLI Commands and Flags

CommandKey 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

CommandAction
mimo auth [command]Manage provider credentials and login.
mimo auth loginConfigure API keys for model providers.
mimo auth listList authenticated providers.
mimo auth lsShort form of mimo auth list.
mimo auth logoutRemove a provider from the credentials file.
mimo mcp [command]Manage Model Context Protocol servers.
mimo mcp addAdd a local or remote MCP server.
mimo mcp listList configured MCP servers and connection status.
mimo mcp lsShort form of mimo mcp list.
mimo mcp auth [name]Authenticate with an OAuth-enabled MCP server.
mimo mcp auth listList OAuth-capable MCP servers and authentication status.
mimo mcp auth lsShort 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 listList MiMo Code sessions.

Slash Commands

CommandAction
/connectAdd a model provider and API key.
/compactCompact the current session.
/summarizeAlias for /compact.
/detailsToggle tool execution details.
/editorOpen an external editor through the EDITOR environment variable.
/exitExit MiMo Code.
/quitAlias for /exit.
/qAlias for /exit.
/exportExport the current conversation to Markdown and open it in the default editor.
/helpShow the help dialog.
/initCreate or update AGENTS.md.
/modelsList available models.
/newStart a new session.
/clearAlias for /new.
/redoRestore a previously undone message and file changes.
/sessionsList and switch between sessions.
/resumeAlias for /sessions.
/continueAlias for /sessions.
/shareShare the current session.
/themesList available themes.
/thinkingToggle reasoning-block visibility in the conversation.
/undoRemove the last message and revert file changes through Git.
/unshareStop sharing the current session.
/goalSet a natural-language stopping condition for the session.
/voiceStart real-time streaming voice input for logged-in MiMo users.
/dreamScan recent session traces, extract persistent project knowledge, and remove outdated memory entries.
/distillFind repeated manual workflows and package high-confidence patterns into reusable skills, subagents, or commands.

Built-in Agents

AgentRole
buildDefault primary agent with full tool access.
planRead-only analysis and planning agent.
composeWorkflow-driven primary agent with built-in skills.
generalSubagent invoked by primary agents.
exploreSubagent invoked by primary agents.

Compose Skills

SkillPurpose
compose:tddTest-driven development workflow.
compose:debugSystematic debugging.
compose:verifyCompletion verification.
compose:brainstormFeature brainstorming.
compose:planImplementation planning.
compose:executeApproved plan execution.
compose:parallelParallel agent dispatch.
compose:reviewCode review request.
compose:feedbackReview feedback handling.
compose:worktreeGit worktree workflow.
compose:mergeDevelopment branch merge.
compose:subagentSubagent-driven development.
compose:new-skillNew skill authoring.

Core Config Fields

  • .mimocode/mimocode.json Project-level configuration
  • ~/.config/mimocode/mimocode.json Global configuration
FieldUse
$schemaJSON Schema URL for editor completion and validation.
modelDefault primary model in provider_id/model_id format.
small_modelLightweight-task model.
providerProvider connection and runtime options.
disabled_providersDisabled provider IDs.
enabled_providersProvider allowlist.
agentCustom agent definitions.
default_agentDefault agent.
commandCustom command templates.
permissionPermission rules for tool actions.
toolTool invocation style.
mcpMCP server definitions.
pluginPlugin package or local path list.
skillsSkill load sources.
lspLanguage Server Protocol integration.
formatterCode formatter settings.
instructionsInstruction file paths or globs.
shareSession sharing mode: manual, auto, or disabled.
autoupdateAuto-update behavior.
compactionContext compaction policy.
checkpointCheckpoint thresholds and quotas.
snapshotSnapshot switch.
watcherFile watcher ignore rules.
servermimo serve and mimo web settings.
enterpriseEnterprise URL configuration.
usernameCustom username.
logLevelRuntime log level.
experimentalExperimental features.

Environment Variables

VariableUse
MIMOCODE_HOMESingle profile root for config, data, state, and cache.
MIMOCODE_CONFIGCustom config file path.
MIMOCODE_CONFIG_DIRCustom config directory.
MIMOCODE_CONFIG_CONTENTInline JSON config content.
MIMOCODE_TUI_CONFIGCustom TUI config path.
MIMOCODE_PERMISSIONInline JSON permission config.
MIMOCODE_DBDatabase file path override.
MIMOCODE_MODELS_URLCustom model manifest fetch URL.
MIMOCODE_MODELS_PATHCustom model manifest local path.
MIMOCODE_GIT_BASH_PATHGit Bash executable path on Windows.
MIMOCODE_PUREPure runtime mode.
MIMOCODE_AUTO_SHAREAutomatic session sharing.
MIMOCODE_DISABLE_SHAREFull session-sharing disable switch.
MIMOCODE_DISABLE_AUTOUPDATEAuto-update check switch.
MIMOCODE_ALWAYS_NOTIFY_UPDATENew-version notification switch.
MIMOCODE_DISABLE_AUTOCOMPACTAutomatic context compaction switch.
MIMOCODE_DISABLE_PRUNEOld-data pruning switch.
MIMOCODE_DISABLE_TERMINAL_TITLETerminal title update switch.
MIMOCODE_DISABLE_MOUSETUI mouse capture switch.
MIMOCODE_DISABLE_DEFAULT_PLUGINSDefault plugin switch.
MIMOCODE_DISABLE_LSP_DOWNLOADLSP 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!