magi-code 0.95.2

Repository-aware CLI coding agent for terminal work
Documentation
# Sessions and context

Sessions preserve conversations so you can leave, resume, branch, export, and manage context.

## Start or resume work

Running `magi-code` creates a saved session by default.

```sh
magi-code --continue
magi-code --resume <SESSION_ID>
magi-code --no-session
```

- `--continue` opens the most recent session.
- `--resume` opens a specific session.
- `--no-session` keeps no resumable conversation history.

Inside Mission Control, `/sessions` lists saved sessions and `/new` starts another one.

## Manage context

Long conversations eventually approach a model's context limit. `/compact` asks a provider to summarize earlier work, then continues from that summary. Local history remains available even though future provider requests use compacted context.

Automatic compaction can be configured under `/settings` → **Context**. Keep it enabled for long-running work unless you need manual control over every compaction.

Compaction uses a provider call and can consume quota.

## Rewind work

Enter `/changes` to inspect recorded change checkpoints. `/rewind` creates a new session from an earlier prompt and can restore tracked file state when a suitable checkpoint exists.

Rewind does not truncate the original session. Review the result: external changes, shell side effects, and unsupported files may not be recoverable.

## Export a session

Enter `/export` while idle. Magi-code writes a ZIP containing the raw session and related history.

Exports are unencrypted and may include prompts, responses, tool data, repository paths, and source content. Inspect an export before sharing it.

## Delete old sessions

```text
/prune-sessions
/prune-sessions 7
```

The default removes sessions older than 30 days. Supplying a number changes the cutoff. Active sessions remain. Deletion is permanent for resume purposes.

## Progress summaries

Open **Summary** or press `Alt-3`, then choose **Start**. The session summarizer turns recent activity into short progress entries.

Summarizing makes additional provider calls and sends recent session activity after redaction. It is a progress view, not a complete audit and not a replacement for compaction.

To enable it automatically, set:

```json
{
  "agent": {
    "summarizer": { "auto_start": true }
  }
}
```

You can select a separate summarizer provider, model, reasoning level, and replacement prompt in settings.

## Advanced reference

See [Sessions, context, and cache](../features/sessions-context-cache.md) and [Session summarizer](../features/session-summarizer.md) for retention, checkpoint, export, compaction, storage, and provider-call details.