memory-search

A way to query MiMoCode’s raw SQLite activity database directly. SQLite is a local database format, and the database records sessions, messages, tool calls, statuses, and execution details.

In plain words
What is it for?
Use it to find repeated errors, group or count tool calls, inspect complete session activity, filter events by conditions, and check whether a remembered detail matches the recorded history.
Why use it?
It helps investigate past sessions when ordinary memory or history search is not enough. Structured queries can find patterns, count events, and verify what actually happened.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/xiaomimimo/mimo-code/memory-search
Any agent
npx skills add XiaomiMiMo/MiMo-Code --skill memory-search
Clone the repo
git clone --depth 1 https://github.com/XiaomiMiMo/MiMo-Code

Made for: Claude Code, Codex.

Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,953 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00078 $0.01953
Opus 5 $0.00039 $0.00977
Sonnet 5 $0.00016 $0.00391
Haiku 4.5 $0.00008 $0.00195

Measured yesterday against content hash b0a34e7878f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-search scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/opencode/src/skill/builtin/.bundle/memory-search/SKILL.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Search: SQLite Trajectory Database

Direct SQL access to mimocode's trajectory database for structured analysis that the memory (BM25 over curated markdown) and history (FTS over raw messages) tools cannot perform — aggregation, filtering by tool/status/time, cross-session pattern detection, and execution chain inspection.

When to use

  • You need to aggregate or count across sessions (e.g. "which tool fails most often?", "how many sessions touched file X?").
  • You need to filter by structure — tool name, status, agent_id, time range — not just text content.
  • You need to view a complete execution chain for a session (every tool call in order).
  • You need to verify a memory claim against what actually happened (the DB is the source of truth).
  • The memory and history tools returned nothing useful despite multiple query attempts.

Locating the database

# Typically at this path. MIMOCODE_DB env var overrides if set.
sqlite3 -readonly ~/.local/share/mimocode/mimocode.db ".tables"

Always use -readonly or only SELECT queries — never modify the database.

Schema

Table Purpose Key columns
session Session metadata id, project_id, title, time_created, parent_id
message User/assistant turns id, session_id, agent_id, time_created, data (JSON: $.role)
part Message parts (text, tool calls, steps) id, message_id, session_id, time_created, data (JSON)
task Task tree id, session_id, summary, status
task_event Task state transitions id, session_id, task_id, at, kind, summary
actor_registry Subagent/peer history session_id, actor_id, agent, mode, status, description

Part types in part.data

  • {"type":"text","text":"..."} — agent text output
  • {"type":"tool","tool":"<name>","callID":"...","state":{"status":"completed","input":{...},"output":"..."}} — completed tool call
  • {"type":"tool","tool":"<name>","callID":"...","state":{"status":"error","input":{...},"error":"..."}} — failed tool call (no output field; error message in $.state.error)
  • {"type":"step-start"} / {"type":"step-finish","tokens":...} — step boundaries
  • {"type":"compaction","auto":true/false} — compaction boundary
  • {"type":"checkpoint",...} — checkpoint/rebuild boundary

Read the full file on GitHub · 166 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 166 lines · 78 tokens per session scan A b0a34e7878f7

Subscribe to this mod's changes

memory-search is a skill published in the GitHub repository XiaomiMiMo/MiMo-Code (12,904 stars, last pushed 2d ago), licensed MIT. It adds 78 tokens to every session and 1,953 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

xiaomi-tts

Use this skill when the user wants to convert text to speech using Xiaomi MiMo's TTS models (mimo-v2.5-tts). Uses OpenAI-compatible chat/completions API with audio response. Supports multiple preset voices and custom voice design. Use when 用户提到 语音合成、文字转语音、TTS、朗读、读出来、生成语音、 生成音频、文本转音频、配音、念出来、小米语音、MiMo 语音、小米 TTS。.

desirecore/market · 116 tokens

byok-custom-model

Register a custom LLM endpoint with your own API key for chat in Starchild. Use when adding a personal Anthropic, OpenAI, Grok, Qwen, DeepSeek, Meta (Muse Spark), NEAR AI, or Venice key as a chat model (e.g. add my Claude key, register DeepSeek, use Muse Spark 1.1).

Starchild-ai-agent/official-skills · 80 tokens

deepseek-vision

MUST use when the user sends or asks about images, photos, screenshots, pictures, audio, video, or mixed media documents, including requests to OCR/read text from an image. Route all media through Xiaomi MiMo V2.5 (mimo-v2.5) and mimo-v2.5-asr via scripts/mimo.py; never use local OCR, viewimage, native vision…

reF0o0/deepseek-vision-skill · 108 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens