# MiMoCode Configuration Reference ## File locations & precedence Config is JSON or JSONC. MiMoCode discovers it by walking up from the cwd to the worktree root, then falls back to global. - Project: `.mimocode/mimocode.json` or `.mimocode/mimocode.jsonc` - Global: `~/.config/mimocode/mimocode.jsonc` or `mimocode.json` (XDG config dir). New installs seed `mimocode.jsonc`. - Extra config dirs are also searched via `$MIMOCODE_CONFIG_DIR`. Project config merges **over** global. Always include `"$schema": "https://mimo.xiaomi.com/mimocode/config.json"` for validation. ## On-disk data layout Base directories resolve from `MIMOCODE_HOME` if set (must be absolute → `/{data,cache,config,state}`), otherwise from XDG: | Kind | Default location | Holds | |------|------------------|-------| | data | `~/.local/share/mimocode/` | memory, logs, `builtin_skills//`, bin | | config | `~/.config/mimocode/` | global `mimocode.jsonc` / `mimocode.json` | | cache | `~/.cache/mimocode/` | caches, downloaded bins | | state | `~/.local/state/mimocode/` | runtime state, including TUI recent/favorite models in `model.json` | Memory files live under `~/.local/share/mimocode/memory/`: - `projects/global/MEMORY.md` — project memory - `sessions//checkpoint.md`, `notes.md`, `tasks//progress.md` - `global/MEMORY.md` — cross-project user preferences ## Environment variables & flags - `MIMOCODE_HOME` — override all base dirs (absolute path). - `MIMOCODE_CONFIG_DIR` — extra config directory to search. - `MIMOCODE_PURE` — run without external plugins (same as `mimo --pure`). Does **not** change models or Claude Code inheritance. - `MIMOCODE_DISABLE_LOG_ROTATION` — keep a single growing log file instead of rotating. - `MIMOCODE_TEXT_TOOL_CALL_RETRY_LIMIT` — retries when a model emits a tool call as prose markup instead of a structured call (default 2). - `MIMOCODE_EXPERIMENTAL_CRON` — scheduled prompts (cron/loop); **on by default**. `MIMOCODE_DISABLE_CRON` kills it at runtime. Tune loop keepalive with `MIMOCODE_LOOP_KEEPALIVE_BUDGET` (default 1) and `MIMOCODE_LOOP_KEEPALIVE_DELAY_S` (default 1200). - `MIMOCODE_EXPERIMENTAL_TOKEN_EFFICIENCY_HEURISTIC` — shape-based compaction of bash output to save tokens; off by default. - `MIMOCODE_MIMO_ONLY` — pure-MiMo mode: don't inherit Claude Code settings (CLAUDE.md, `~/.claude/CLAUDE.md`), don't read provider API keys from env, fall back to the mimo-auto model. - **External skill roots** — default load surface is `.mimocode` + open-standard `.agents`. Brand roots are opt-in: `MIMOCODE_ENABLE_CLAUDE_CODE_SKILLS`, `MIMOCODE_ENABLE_CODEX_SKILLS`, `MIMOCODE_ENABLE_OPENCODE_SKILLS`. Turn agents off with `MIMOCODE_DISABLE_AGENTS_SKILLS`. External scans skip dotted path segments under `skills/`. - `MIMOCODE_ENABLE_CLAUDE_IMPORT` — automatically import Claude Code sessions on startup; off by default. Set to `true` or `1` to enable. Manual session imports remain available; Codex sessions are imported only on explicit request. - `MIMOCODE_CODEX_MODE` — Codex mode (the Codex system prompt, the `exec` / `apply_patch` / `view_image` toolset, and MCP tools always deferred except `alwaysDirectTools`); **off by default for every model, GPT included** — all models get the same default system prompt and toolset. `true` turns it on for sessions that don't choose a harness; `false` forces it off even for SDK sessions that request harness `codex`. - `MIMOCODE_ENABLE_EXEC_TOOL` — expose the `exec` tool-script orchestration tool outside Codex mode; off by default. - `MIMOCODE_DISABLE_BUILTIN_SKILLS`, `_PROJECT_CONFIG` — feature toggles. ## Top-level config keys All optional. ### Models & providers | Key | Purpose | |-----|---------| | `model` | Primary model, `provider/model` (e.g. `anthropic/claude-2`) | | `small_model` | **Legacy / not recommended** — carried over from OpenCode for back-compat. Prefer configuring the `lite` group instead. If set, its literal `provider/model` still wins for cheap tasks (title generation, etc.); if unset, cheap tasks route through the `lite` group | | `model_groups` | Named capability tiers usable anywhere a model string is accepted — see [Model groups](#model-groups) | | `provider` | Custom provider configs & model overrides | | `enabled_providers` / `disabled_providers` | Allowlist / blocklist providers | For custom endpoints, adapter selection, provider reuse, credential handling, and verification, read @providers.md before editing. ### Model groups `model_groups` lets you define named capability tiers and reference them by name (e.g. `"ultra"`) anywhere a `provider/model` string is accepted — the `model` key, an agent's model, the `actor` subagent `model` argument, and workflow model tiers. Each group maps a name to either a single default model (string shorthand) or an object with a `default` plus optional member `models`: ```jsonc { "$schema": "https://mimo.xiaomi.com/mimocode/config.json", "model_groups": { // string shorthand: the group IS its default model "lite": "anthropic/claude-haiku", // object form: a default plus alternates on other providers "standard": { "default": "anthropic/claude-sonnet", "models": ["anthropic/claude-sonnet", "openrouter/xiaomi/mimo-v2.5"] }, "ultra": "anthropic/claude-opus-4-8" }, "model": "standard" } ``` **Resolution rules:** - A ref containing `/` is a literal `provider/model` and is used as-is. - A ref without `/` is a group name. If configured, MiMoCode is **provider-aware**: it prefers a member on the caller's current provider, otherwise falls back to the group's `default`. - `ultra`, `standard`, `lite` are **built-in tier names**. If you reference one but haven't configured it, it silently falls back to the default model (zero-config never errors). - Any other unconfigured name errors with fuzzy suggestions of your defined groups. - Cheap-task (small) model: **configure the `lite` group** — that is the recommended path. The legacy `small_model` literal, if set, still takes precedence for back-compat, but is not recommended for new configs. Use groups when you want one label (`"standard"`) to map to different concrete models per provider, or to swap tiers globally without editing every agent/model reference. ### Agents | Key | Purpose | |-----|---------| | `default_agent` | Primary agent when none specified (falls back to `build`) | | `agent` | Per-agent config: `plan`, `build`, `general`, `explore`, `title`, `summary`, `compaction`, plus custom | | `username` | Display name in conversations | Prefer a markdown file (`.mimocode/agent/.md`, body = system prompt) for defining a custom agent/mode — see the "Custom agents & modes" section in @guide.md. Use the `agent` config key for short, inline per-agent overrides. ### Tools, skills, MCP, extensions | Key | Purpose | |-----|---------| | `skills` | `paths[]` extra skill folders + `urls[]` remote skill indexes | | `mcp` | MCP servers: `local` (command/env) or `remote` (url/headers/oauth); `{ "enabled": false }` disables one; `sampling` sets the client-sampling policy (`deny`/`ask`/`allow`, default `ask`); `alwaysDirectTools` (see below) | | `tools` | Record of tool-id → boolean enable/disable | | `command` | Custom slash commands | | `plugin` | Plugin specs | | `formatter`, `lsp` | Formatter & language-server config | | `instructions` | Extra instruction files/globs to include | | `permission` | Permission rules incl. `external_directory` allowlist | MCP tools are normally deferred behind `mcp_tool_search` / `mcp_tool_use`. List tool names in a server's `alwaysDirectTools` to expose them as top-level tools instead — e.g. `"alwaysDirectTools": ["run"]` on server `sandbox` exposes `sandbox_run`. ### Context management As context fills, MiMoCode auto-checkpoints (a background writer distills the conversation into `checkpoint.md`) and, near the limit, **rebuilds**: it appends a boundary that carries the last successful checkpoint, a list of the activity since it and any unanswered prompt in full, so the next request starts from that boundary. If a checkpoint writer is still running when a rebuild is needed, the rebuild waits for it (with a visible "Preparing conversation context…" status) — briefly when a usable checkpoint already exists, longer for the very first one — then proceeds; if no checkpoint can be produced it falls back to lossy compaction. You can trigger a rebuild yourself any time with the `/rebuild` slash command. The trigger is the model's prompt capacity (`limit.input` when the provider publishes one, else `limit.context`) minus the reserves, optionally lowered by `compaction.max_context`. `mimo models ` prints the resolved window and the trigger per model, and `/status` shows both plus the current usage. Two things users hit here: a model's usable window depends on the route (ChatGPT/Codex subscription vs direct API key vs a reseller like OpenRouter can all differ for the same model name, and a 1M catalog figure does not mean the route serves 1M), and providers may price very long prompts higher (OpenAI charges 2x input / 1.5x output for GPT-5.6 requests above 272K input) — `compaction.max_context` is the knob for both. | Key | Purpose | |-----|---------| | `compaction.auto` | Auto-compact when context full (default true) | | `compaction.tail_turns` | Recent user turns kept verbatim (default 2) | | `compaction.preserve_recent_tokens` | Max recent tokens kept verbatim | | `compaction.reserved` | Token buffer to avoid overflow | | `compaction.max_context` | Compact earlier than the model window. One value for all models, or a map keyed `"/"` (wildcards allowed, longest pattern wins). Values: token count, `"300K"`, `"1M"`, or `"50%"` of the window. Always clamped to the provider cap — can only lower the trigger, never raise it. `0` = no budget. Set it from the TUI with `/context-limit` | | `checkpoint.thresholds` | Context-fill triggers, e.g. `["40%","60%","80%"]` | | `checkpoint.reserved` | Token buffer for checkpoint ops (default 20000) | | `checkpoint.fork` | Fork parent prefix into writer session for cache reuse (default true) | | `checkpoint.push_caps.*` | Per-section token caps for rebuild context (tasks_ledger, focus_task, checkpoint, memory, notes, global, recent_user, …) | | `checkpoint.task_archive_days` | Days before done/abandoned tasks filtered out (default 7) | | `checkpoint.memory_search_score_floor` | BM25 relative floor for memory search (default 0.15) | | `memory.cc_index` | Index Claude Code memory under scope `cc` (default false; see privacy note in schema) | | `history` | Conversation-history FTS index config | ### Autonomous / self-improvement | Key | Purpose | |-----|---------| | `dream.auto` / `dream.interval_days` | Auto memory consolidation on session start (default true / 7 days) | | `distill.auto` / `distill.interval_days` | Auto workflow packaging (default true / 30 days) | | `voice.asr_model` | ASR model (default `xiaomi/mimo-v2.5-asr`) | | `voice.control_model` | Voice control model (default `xiaomi/mimo-v2.6-flash`) | | `workflow.maxConcurrentAgents` | Process-wide subagent concurrency ceiling (default min(16, 2×cores)) | | `workflow.maxDepth` | Max workflow nesting depth (default 8) | ### Experimental | Key | Purpose | |-----|---------| | `experimental.maxMode` | `max` agent runs N parallel reasoning candidates, judge picks winner (`candidates`, default 5) | | `experimental.batch_tool` | Enable the batch tool | | `experimental.predict_next_prompt` | Inline ghost-text next-prompt prediction (default on) | | `experimental.continue_loop_on_deny` | Keep looping when a tool call is denied | | `experimental.primary_tools` | Tools restricted to primary agents | | `experimental.mcp_timeout` | MCP request timeout (ms) | ### Misc | Key | Purpose | |-----|---------| | `autoupdate` | `true` / `false` / `"notify"` | | `snapshot` | Filesystem snapshot tracking for undo/redo (default true) | | `logLevel` | Log verbosity | | `server` | Config for `mimo serve` | ## Example: common tweaks ```jsonc { "$schema": "https://mimo.xiaomi.com/mimocode/config.json", "model": "anthropic/claude-opus-4-8", "model_groups": { "lite": "anthropic/claude-haiku" }, "dream": { "auto": true, "interval_days": 3 }, "compaction": { "tail_turns": 3 }, "permission": { "external_directory": { "/tmp/**": "allow" } }, "mcp": { "my-server": { "type": "local", "command": ["node", "server.js"] } } } ```