Adding memory to MiniMax Code

one command for the MCP server, the skill and the hooks

MiniMax Code keeps every session on disk and opens the next one empty. What you worked out last week is still there, and so is the work you did in whichever other agent you had open at the time.

What MiniMax Code already has

Sessions live under ~/.minimax/v2/sessions/YYYY/MM/DD/<session>/, one directory per conversation sharded by the day it started, with the transcript in messages.jsonl beside a manifest.json. DEJA_MCODE_ROOT points deja at another session root. mcode --session <id> reopens one. Complete, and unread by anything — including by MiniMax Code's next session.

The transcript records no working directory; the runtime keeps that in its own SQLite database, and deja reads it with sqlite3 to file each session under its project and to find where to resume it. The transcripts themselves read without sqlite3, and a session is then filed by where its file activity was.

Adding recall

deja install mcode-auto

That needs the binary:

brew install deja-vu
# or
curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh

Without hooks, deja install mcode writes only the MCP server, and the agent searches when it decides to.

What gets wired

deja install mcode writes one server named deja into ~/.minimax/mcp.json, the file MiniMax Code's own MCP page writes. deja install mcode-auto also writes a MiniMax-format plugin under ~/.minimax/plugins/deja/, which carries the deja-history skill — MiniMax Code has no user-level skill directory, so the skill lives in the plugin — and these hooks:

  • The project digest on SessionStart: what this project's past sessions settled, before you type anything.
  • Recall on UserPromptSubmit, silent when the history has no answer.
  • A line about the file on PreToolUse before a bash, edit, write or read, and the repair for a failed command on PostToolUse after bash.
  • Compaction recovery on PreCompact: the hook reads the session from the store by its id, and the next prompt gets the task back.
  • SessionEnd, so the session you just quit is one the next session's recall can answer.

The plugin carries no MCP server of its own — the entry in mcp.json is the one — so a machine with both does not list the tools twice.

The part that is not about this harness

The index covers every agent's transcripts on the machine — forty-three of them today, each in its own format — so a fix found in one tool answers a question asked in another, including sessions from before any of this was installed. That is the reason to index rather than to capture.

Nothing here writes memories, so there is nothing to hallucinate into your history; indexing and search are local, and credentials are stripped as the index is built (privacy). What memory costs has the measured comparison.

Getting started · How MiniMax Code's store is read · Resuming a session

Found this useful? Star deja-vu on GitHub.