# MiniMax Code

> Import MiniMax Code CLI, desktop, and cloud histories and Markdown memories.

MiniMax Code's CLI and desktop share a local runtime. Hansard imports each
native session once and offers a separate explicit cloud reader.

## Source IDs

| Source               | Use it for                                   |
| -------------------- | -------------------------------------------- |
| `minimax-code`       | Shared CLI and desktop local histories.      |
| `minimax-code-cloud` | One known cloud session, fetched explicitly. |

## How the import works

The local runtime stores primary message envelopes in dated session
directories. Hansard starts with those messages and follows verified
pre-compaction snapshots to retain earlier conversation content. Stable
message identities prevent surviving messages from being counted again.
Older ledgers replay appends, replacements, retractions, and deletions when
primary history is absent. SQLite message stores provide a final fallback.

Request usage is stored separately from the active transcript, which can
shrink during compaction. Hansard gives durable usage precedence over
mirrored assistant counters. It preserves actual response model identifiers,
cache usage, tools, and reported costs while retaining selected model settings
as metadata. Database snapshots include only allowlisted history tables.
Credentials and unrelated application settings stay outside those copies.

## Import and keep current

**Conversation history**

```sh
hansard import --source minimax-code --since all
hansard config sources enable minimax-code
```

Discovery covers `~/.minimax`, legacy `~/.mavis`, and named profiles.
`MINIMAX_DATA_DIR` or `MAVIS_DATA_DIR` adds an explicit directory.
`HANSARD_MINIMAX_CODE_ROOTS` selects a path-separated list of data roots.

For cloud history, supply `MINIMAX_CODE_ACCESS_TOKEN` from an authorized
account, then run:

```sh
hansard import minimax-code-cloud --session <session-id>
```

`HANSARD_MINIMAX_CODE_CLOUD_ORIGIN` can select `https://agent.minimax.cn`
or the legacy `https://agent.minimaxi.com` origin instead of the default
`https://agent.minimax.io`. Cloud imports stay outside the local watcher.

**Memories and instructions**

```sh
hansard memory backup
```

Backup captures user and agent Markdown memories, topic and daily files, and
project `AGENTS.md`. Agent memories retain global scope; project instructions
retain their recorded project scope. Skill folders are not memories and are
not backed up.

## Review the import in the app

1. When the import finishes, open **Conversations** and select **Filter & sort**.
2. Set **Source** to **MiniMax Code** and set **Time** to the window you imported. Use **Folder** to narrow the list when you use this harness in several projects.
3. Select a conversation to check its messages, tool calls, files, commits, model, and token usage.

To keep archiving new sessions from a local harness, open **Settings → Imports**. **Automatic** follows every supported harness installed on this computer. **Custom** lets you turn individual harnesses on or off. Cloud sources and account exports never run from here; each needs its own import command. If a conversation you expect is missing after you reset the filters, run the import command on this page again with `--explain-skips` where the source supports it.

Check tool arguments, edit diffs, parent-session links, model usage, and
memory scopes. CLI and desktop histories share the MiniMax Code local label.

## What Hansard preserves

- Primary messages, verified compaction history, reasoning, tools, and results.
- Durable request counts, token directions, cache usage, and reported costs.
- Parent tasks, scheduled-session classification, and native session metadata.
- Raw history files, database history copies, reports, and asset descriptors.
- Markdown memories and project instructions with versioned snapshots.

## Known limitations

Missing compaction snapshots are reported; unavailable history cannot be
reconstructed. Unlinked snapshots remain raw-only. Referenced local or remote
attachment bytes are not fetched. Selected models and context-window counters
do not establish inference usage. Malformed authoritative histories reject
the affected session instead of importing an older mirror.

The official cloud reader exposes text, identities, and timestamps. Tools and
usage are imported only when supplied. Cloud session enumeration is not
implemented. An existing local archive with the same identity remains
authoritative. Authenticated desktop, inference, and cloud acceptance remain
pending; synthetic tests do not establish those results.

## Refresh an existing archive

Repeat `hansard import --source minimax-code --since all` after a parser update.
Repeat the explicit cloud import for each selected cloud session. Provider
originals are required; raw-archive replay is not available for these formats.
