M31A records conversations locally so you can resume work, search past sessions, and rewind changes. Conversation records are written by chatRecordingService.ts; a local SQLite index supports session search.
Starting and resuming sessions
m31a --resume latest
m31a --resume 5
m31a --session-file /path/to/session.json
m31a --session-id my-custom-id
m31a --list-sessions
m31a --delete-session 3--resume, --session-id, and --session-file are mutually exclusive. --prompt-interactive executes a prompt and then stays in the interactive UI.
In-app, use:
/chat list|save|resume|delete|share|checkpoints,/resumeto pick a session,/clear(alias/new) to start a new session,/export-sessionto write a session record to disk.
Checkpoints and rewind
Checkpointing records file state so you can restore earlier points in a session. Enable it with:
{
"general": {"checkpointing": {"enabled": true}}
}Use /chat checkpoints to list them, /rewind to return to one, and /restore to restore files. Checkpoint changes are stored with the session record by chatRecordingService.ts.
Session retention
general.sessionRetention controls automatic cleanup:
| Key | Default | Meaning |
|---|---|---|
enabled | true | Enable cleanup. |
maxAge | 30d | Delete chats older than this period. |
maxCount | unset | Keep at most this many recent sessions. |
minRetention | 1d | Safety floor for retention. |
Context compression
As the conversation grows, M31A compacts history automatically. The core chatCompressionService.ts triggers at a fraction of the context window and protects the most recent turns; retrieval tools can be exempted from collapse.
{
"model": {
"compressionThreshold": 0.5,
"maxSessionTurns": -1,
"summarizeToolOutput": {}
},
"contextManagement": {
"historyWindow": {"maxTokens": 150000, "retainedTokens": 40000},
"messageLimits": {
"normalMaxTokens": 2500,
"retainedMaxTokens": 12000,
"normalizationHeadRatio": 0.25
}
}
}Manual controls: /compress (aliases /summarize, /compact) and /context-window. The PreCompress hook event runs before compaction.
Workspace memory (M31A.md)
M31A discovers M31A.md files as durable instructions. The discovery walk stops at configured boundary markers (.git by default). Use /init to create a starter file, /memory show to inspect loaded memory, and /memory reload to refresh it. See Configuration for the related settings.
Including extra directories
m31a --include-directories ../lib,../sharedOr set context.includeDirectories in settings. Missing directories are skipped, and context.loadMemoryFromIncludeDirectories controls whether their M31A.md files are scanned on reload.
Next steps
- Read Worktrees for isolated sessions.
- Read Headless mode for scripted session usage.