# MiMoCode

> Xiaomi's terminal-native coding agent, with SQLite-backed memory that survives across sessions and works against any OpenAI-compatible provider

- Category: AI Coding / Autonomous Coding Agents
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/XiaomiMiMo/MiMo-Code
- Website: https://mimo.xiaomi.com/mimocode
- Canonical page: https://ai-tldr.dev/tools/mimo-code/
- Updated: 2026-06-10

## In short

MiMoCode is a terminal-native AI coding assistant from Xiaomi's MiMo team. It sits in the Autonomous Coding Agents category of the AI Coding tools and is open-source, written in TypeScript and licensed MIT. To get started: install.

## Overview

MiMoCode is a terminal-native AI coding assistant from Xiaomi's MiMo team. It reads and writes code, runs commands, manages Git and keeps a persistent memory of the project so that understanding built up in one session is still there in the next. The repository is MIT-licensed and written in TypeScript, and the CLI installs from npm as `@mimo-ai/cli` or through a one-line install script.

Work is split across three primary agents you switch between with Tab. `build` is the default and has full tool permissions; `plan` is a read-only analysis mode for exploring code and designing a solution; `compose` is an orchestration mode for specs-driven and skill-driven workflows. After the first message the mode locks — build and plan can still swap, but compose is isolated once entered, which the project says measurably improves tool-call reliability by keeping the skill and tool set fixed from session start.

Memory is the distinguishing piece. Cross-session memory is backed by SQLite FTS5 full-text search and split into project memory (`MEMORY.md`), automatic session checkpoints written by a checkpoint-writer subagent, scratch notes and per-task progress logs. When context approaches the model's limit, MiMoCode rebuilds it from the latest checkpoint, project memory, task progress and the retained recent messages, so a long task can continue rather than restart. It is not tied to Xiaomi's own models: it connects to the Xiaomi MiMo platform, Codex via OpenAI OAuth, an imported Claude Code login, catalogue providers by API key, or any custom OpenAI-compatible endpoint.

## What it does

- Three switchable agents — build (full permissions), plan (read-only analysis) and compose (specs- and skill-driven orchestration)
- Cross-session persistent memory over SQLite FTS5: project MEMORY.md, automatic checkpoints, scratch notes and per-task progress
- Context reconstruction — rebuilds working context from checkpoint plus memory when the model window fills, instead of losing the task
- `/context-limit` sets a working budget smaller than the model's own window so compaction fires earlier
- Connects to any mainstream LLM provider: Xiaomi MiMo OAuth, Codex/ChatGPT OAuth, imported Claude Code auth, API keys, or a custom OpenAI-compatible endpoint
- Client/server split — run `mimo serve` on a remote host and attach locally when the TUI lags over SSH

## Getting started

Install the CLI, run `mimo`, and let the first-launch wizard wire up a provider.

1. Install

   Use the install script on macOS or Linux, PowerShell on Windows, or npm on any platform.

```bash
# macOS / Linux
curl -fsSL https://mimo.xiaomi.com/install | bash

# Windows PowerShell
powershell -ep Bypass -c "irm https://mimo.xiaomi.com/install.ps1 | iex"

# Any platform, via npm
npm install -g @mimo-ai/cli
```

2. Run it and pick a provider

   The first launch walks through configuration. Options include Xiaomi MiMo Platform OAuth, Codex (ChatGPT Pro/Plus) OAuth, importing existing Claude Code authentication in one step, catalogue providers by API key, or adding any OpenAI-compatible API in the TUI.

```bash
mimo
```

3. Switch agents

   Press Tab to move between the primary agents. Start in plan to explore a codebase read-only, then switch to build to make changes.

```text
Tab      # cycle build ↔ plan
ctrl+p   # command palette
```

4. Cap the context budget

   Make the model compact earlier than its own window — useful on very long tasks where you want checkpoints written more often.

```text
/context-limit
```

5. Run the agent on a remote host

   If the TUI lags over SSH, render locally and keep only the server remote.

```bash
# on the remote host
mimo serve --port 4096

# locally: forward the port
ssh -N -L 4096:127.0.0.1:4096 user@remote-host

# locally, in another terminal
mimo attach http://127.0.0.1:4096
```

## When to use it

- Work a long refactor across several sessions without re-explaining the codebase each time
- Explore an unfamiliar repository safely in read-only plan mode before allowing any writes
- Drive a coding agent from a provider you already pay for, including a self-hosted OpenAI-compatible endpoint
- Run the agent on a remote build machine while keeping the terminal UI responsive locally

## Version history

- 2026-06-10: Xiaomi open-sourced MiMoCode under the MIT license — a terminal-native coding agent forked from OpenCode, with a free MiMo-V2.5 backend, SQLite FTS5 memory that persists across sessions, Tab-activated Compose mode and voice input.
