CODING AGENTS IN YOUR TERMINAL

A coding harness
you can inspect.

Follow tool activity, inspect agent instructions, and review current worktree changes. Configure how agents work, all from your terminal.

Written in RustBring your own modelLocal-first sessions
Mission Control · illustrative
Session: 5a06...d731[Alt+1-3] [•] Activities, [•] Files, [ ] Summary • [Alt-A] Pin
Branch: main[Shift-Tab] Cycle Tabs

Transcript

Follow the white rabbit, but take your time.

Useful hotkeys

[Tab] Next pane

[Alt-P] Cycle primary agent

[Shift-Tab] Transcript / Changes tab

[Alt-1] Show/hide Activity Tree

[Alt-2] Show/hide Session Files

[Alt-3] Show/hide Summary

Useful Commands

/skills Manage global / project skills

/settings Edit settings / model availability

/side Open side-chat agent

/summarize-start | /summarize-stop Start / stop Summary agent

/fast Toggle Fast mode where supported

/ultrafast Toggle Ultrafast mode where supported

/compact Compact current session

/update Update Magi-Code

Type a prompt below to begin.

Activity Tree

[Alt-1] Hide [X]

No activity yet. Type a prompt below.

Session Files

[Alt-2] Hide [X]

R read W written E edited

No recorded file activity.

Transcript
Changes
Mission Control readyCodex 82/100%(w) • [Alt-M] openai-codex/gpt-6-astra [Alt-T] (XHigh) • [Alt-P] Agent: None
Session: 0m00s • 0(in) 0(out) —(cache) • Current Ctx: 0% [..........] 272k • Compact at 80%MAGI-CODE v0.101.1
Follow the white rabbit, but take your time. Welcome screen · HTML / CSS

A little closer to the code

Powerful agents you can follow.

magi-code keeps the conversation, tools, and code changes together in one terminal workspace, so you can follow the work you delegate.

It has a compact core prompt, tools built for coding, and agents you can customize. You can inspect what they do as they work.

Inspect the work as it happensDirect prompts and the workflowOwn your session history and settings

01 / Code Mode

Batch tool calls in one script.

Enabled by default, Code Mode lets the agent run a short JavaScript function that calls existing tools, then return only the results it needs.

LIVE PROGRESS

Follow each nested call.

The card shows the script's intent and each tool call as it runs. Nested calls also appear in Activity Tree for closer inspection.

Running Code Mode card Static · synthetic example
● Code Mode • 4 calls12:05:31
Intent: Rename loadSession across routes
3 calls completed
✓ grep  "loadSession"
✓ read  src/routes.ts • 18 lines
✓ hash_edit  Updated src/routes.ts
● hash_edit  Update src/session.ts
COMPLETED BATCH

See what changed.

Completed cards summarize call count, elapsed time, outcomes, and tracked files changed. The footer estimates script tokens sent (out) and result tokens returned to the model (in), not billed usage.

Completed Code Mode card Static · synthetic example
✓ Code Mode • 7 calls • 1.8s12:05:33
Intent: Rename loadSession across routes
✓ 7 succeeded
3 tracked files changed
  src/routes.ts
  src/session.ts
  src/auth.ts
✓ hash_edit  Updated src/routes.ts
✓ read  src/auth.ts • 24 lines
✓ hash_edit  Updated src/auth.ts
✓ hash_edit  Updated src/session.ts
≈186 out · ≈412 in
SAME GUARDRAILS

No shortcut around approvals.

Every nested call uses the normal tool path: approvals, hooks, cancellation, and session records. Execution time, memory, and output have configurable limits; waiting on tools does not use the script's time budget.

tools.callAll sends up to 32 independent calls at once. Reads, searches, web lookups, and image inspection share four workers and return results in input order.

Not a transaction. Completed edits and commands stay applied after a later failure or cancellation, and the card says so. Enabled by default unless explicitly disabled in settings. Change it under /settings → Tools → Code Mode, save, then restart.

Read the Code Mode reference

02 / Visibility

See how the work gets done.

Follow the steps, context, and code changes behind an agent's answers.

These HTML excerpts use sample content and the selected magi-code theme.

ACTIVITY TREE

Inspect each tool call.

Activity Tree shows the steps as they happen. Open Selected Activity Detail to inspect a call's status, submitted parameters, and captured output.

1. Select an activity Static · synthetic example
Activity Tree
12:03:10 • ✓ read src/session.ts
12:03:12 • ✓ read src/routes.ts
12:03:14 • ✓ hash_edit src/session.ts
12:03:18 • ✓ bash npm test

In Mission Control, click a row to open a separate detail modal. You can also select a row with ↑ / ↓ and press Enter.

Expand Metadata / Params to inspect inputs and result metadata. It starts collapsed; this example shows it expanded.

Esc closes the detail and returns you to the tree.

Inside Mission Control
2. Inspect its details Expanded metadata · synthetic excerpt
Selected Activity Detail
Esc close
Status: SUCCESS
Tool • bash • bash npm test
─
▾ Metadata / Params
{
  "metadata": {
    "exit_code": 0,
    "timed_out": false
  },
  "params": {
    "command": "npm test",
    "intent": "Verify session restore"
  }
}
─
Sanitized Output:
stdout:
✓ restores saved sessions
✓ rejects expired sessions
2 tests passed

stderr:
Up/Down · PageUp/PageDown scroll

These views appear in sequence, not as simultaneous TUI panes. The detail excerpt is shortened for space. Captured output has per-tool limits, with credentials redacted and terminal-control sequences sanitized.

TOOL TRANSCRIPT

Follow tool calls in context.

Each tool call has its own card that starts with the agent's stated intent. See what was read and what changed, then use Activity Tree for a closer look.

Transcript cards Static · synthetic example
✓ Read12:03:10
Intent: Inspect session loading
src/session.ts • 3 lines≈24 out · ≈31 in
✓ Hash Edit • +1 −112:03:14
Intent: Check expiry when restoring
Updated src/session.ts
-  return load(id);
+  return loadSaved(id);≈58 out · ≈22 in

Tool cards stay compact in the transcript; Activity Tree has the details.

SESSION FILES

See which files agents use.

See the files your agent reads, writes, and edits through the dedicated file tools, including subagent activity. Loaded skills and their references appear above the tree with load counts. With optional Jev Bash file tracking, shell commands add entries labeled (inferred).

Session files pane Static · synthetic example
Session Files
R read  W written  E edited
Loaded skills (load count)
 • api-testing (1)
  references/supertest.md (1)
Files
├── src/
│   ├── auth.ts R
│   ├── routes.ts R
│   └── session.ts R E
└── tests/
    └── session.test.ts W

A view of recorded file activity, not a full filesystem audit. Inferred Bash entries are never confirmed edits, and capture limits can leave gaps.

DIFF REVIEW

Review current worktree changes.

Inspect side-by-side diffs with synchronized scrolling. Leave comments on the code, then send unresolved feedback to the agent with #diff-changes.

Read the diff review guide
Diff body + open comment editor Static · synthetic example
Files · /repo
src/
E   session.ts
    [•] D:2 Missing ID?
[Refresh · F5]
Original
1 function restore(id) {2   return load(id);3 }
Diff (old → new)
   1 1 function restore(id) {   2  -  return load(id);[•]  2+  return loadSaved(id);   3 3 }
Comment src/session.ts:2 [•]
[Esc] close
Missing ID?
Handle a missing session before we continue.

A body excerpt: Mission Control keeps its prompt and tab rail outside this view. Scroll horizontally on smaller screens; the three-pane layout stays intact.

03 / Your assistant

Direct the work. Choose the approach.

Work with your primary agent in the main conversation. Choose its persona, inspect its instructions, and guide the task as it develops.

Conceptual workflow · not a TUI screen YOU
Primary agentYour task and chosen persona
RulesToolsChanges
PRIMARY AGENT

Shape how your assistant works.

Your primary agent follows your request, uses coding tools, and keeps the task in one conversation. Choose a persona to set its approach and repository instructions to establish local conventions.

Configure your assistant

Subagents are off by default, including in Code Mode. Enable them for independent tasks; children use extra provider quota and may edit shared files.

Opt in to subagents
THE SUMMARY OBSERVER

Read summaries as you work.

Enable the optional observer and choose its model. It writes summaries of changes and decisions in a dedicated panel.

Summary pane Static · synthetic example
Summary
[ Stop ] Waiting · Enter

── Entry 1 · Latest ──
Separated session loading from route
handling. Next: handle missing sessions
and verify the recovery path.

The observer is off by default. It has no tools, makes additional provider calls, and does not replace session history.

How summaries work
SIDE CONVERSATIONS

Ask a question on the side.

Open /side for a separate conversation without the primary session's context. Ask a question or explore an idea while the main task continues.

Side conversations share the working directory, so a side agent can still change the same files.

Use side conversations

04 / Sessions + context

Pick up where you left off.

Return to an earlier conversation or try a different direction. Compaction makes room in context for the next part of the task.

Rewind a session.

Rewind the conversation, captured file changes, or both. Conversation rewind forks history, so trying a different direction doesn't overwrite the original conversation.

File restore covers captured write/hash_edit changes, not shell commands or external edits. Conflicts can be skipped.

Find a saved conversation.

The session switcher previews the first and recent messages, so you can recognize a conversation without relying on its session ID.

Browse saved sessions

Continue as context fills.

Automatic compaction summarizes earlier context to make room for the next part of your task. Keep working in the same conversation as context fills.

Optional Progressive Session Maintenance (PSM) writes background summaries of saved session events. It is off by default and makes extra provider calls.

Sessions, rewind & compaction

05 / Customization

Configure it for how you work.

Start with a capable coding harness, then adjust its models, instructions, skills, and appearance to suit your workflow.

GLOBAL AND PROJECT SETTINGS

Set defaults. Override them per project.

Manage global and project settings. Enable or disable skills and tools for the environment you're working in.

Use repository instructions for local conventions and a primary persona for your assistant's approach. Choose a theme you like.

Command map · not a Settings screenshot
/settingsGlobal / project settings editor
/skillsGlobal / project skills
/themeYour terminal palette
Configure magi-code
LOCAL-FIRST, PLAIN FILES

Keep your history locally.

Sessions, settings, checkpoints, and agent profiles live on your machine. You don't need a separate workspace service to store your history.

Default directory structure · not a TUI screen

~/.magi-code/

├── settings.json

├── sessions/ JSONL history

├── agents/ Primary personas

└── subagents/ Specialist profiles

Move the runtime home with MC_HOME. Keep project settings in .magi-code/settings.json inside the working directory.

Local storage is not offline inference: prompts, selected context, and tool results are sent to your configured provider.

Built-in tools

Keep context focused on the task.

The compact core and coding tools help agents find and understand code, make changes, and check their work. Useful defaults let you start without a stack of required integrations.

COMPACT BY DESIGN

Leave room for your code.

The core prompt avoids duplicating provider-native tool schemas. Focused reads, structural search, and bounded output help agents inspect the relevant parts of a repository.

Inspect the assembled prompt and its local token estimate with /system-prompt.

Prompt size grows with your instructions, skills, and profiles. Provider tool schemas are sent separately.

See how prompts are built

Find the relevant code

Use file discovery, bounded text search, and AST-aware code search to find and read relevant lines instead of the whole repository. Independent reads and searches run in parallel.

Make targeted changes

Anchored edits and file writes return explicit results. Run shell commands to build, check, and investigate. Dev servers and watchers can run as background jobs; /background-jobs lists them and stops one with k.

Research beyond the repository

Search the web, open public pages, and inspect images. Add reusable guidance through skills and external tools through MCP when you need them.

Browse the built-in tools

06 / Jev-native functionality

Give agents bounded judgment.

magi-code integrates TypeSafe Jev for fast, typed semantic decisions. Your main model keeps control of the task; Jev answers focused questions with structured probabilities.

01
BASH PROTECTION

Assess commands before execution.

Jev checks destructive effects, credential exposure, privilege changes, and untrusted execution separately. Commands above your threshold, or with insufficient confidence, stop for approval.

02
PROSE PROTECTION

Check comments and documentation.

Before file changes run, Jev can identify prose and reject writing that needs a clearer, more natural revision.

03
PROMPT INJECTION PROTECTION

Inspect untrusted tool output.

Selected tool results can be checked for agent-directed instructions, injection likelihood, and impact before they enter model context.

04
COMPLETION VERIFICATION

Check the answer before it ships.

Jev compares a proposed response with current-turn evidence and reports passed, failed, unknown, or unavailable. Only a supported failure sends the agent back to work.

05
BASH FILE TRACKING

See files that shell commands touch.

Jev infers which files a successful Bash command read, wrote, or edited, in bounded background work. Simple literal reads are recognized locally. Results appear on the Bash card and in Session Files.

Inferences survive reloads but never count as confirmed mutations or grant edit anchors. Enable under /settings → Optional Features, then restart.

Bash card with file tracking Static · synthetic example
✓ Bash • exit 012:06:02
Jev: Humanize protection • not reported
Jev: Bash protection • allowed automatically
Jev: File tracking • completed
Jev: Inferred file activity • 2 files inferred in
supported selection • R 1 / W 0 / E 1 • selected first
2 of 2 entries; 0 unsupported • complete selection •
not verified effects
Intent: Rename load call
sed -i '' 's/load(/loadSaved(/' src/session.ts && cat src/routes.ts≈46 out · ≈38 in

Bring your model

Choose a model for your work.

Use your existing provider access for the primary agent. Choose separate models for optional side conversations and summaries when you need them.

Codex

Connect your Codex-enabled ChatGPT account through browser OAuth. See quota windows and reset times in Mission Control. Request eligible faster tiers with /fast or /ultrafast; Ultrafast carries higher usage charges.

/login openai-codex

Claude

Use your claude.ai subscription through installed Claude Code, or choose Anthropic API access with a key. Eligible explicit [1m] subscription selections allow extended context; account and CLI support still apply.

claude auth login

OpenAI-compatible

Configure an API-root base URL and an optional key from an environment variable. Connect compatible hosted services or local endpoints.

Your endpoint and models

Research in the same workspace.

With Codex active, web search uses the Codex backend. Other providers use Exa with EXA_API_KEY. Public URL opening needs no search key; explicit shell curl handles custom HTTP work. These are distinct paths, not automatic fallbacks.

Provider setup

Before your first prompt

Common questions.

What do I need to get started?

You need Rust 1.99 or newer, Cargo, a terminal, and a supported provider account or API key. Install magi-code, launch it in a repository, and connect your provider. Built-in file, search, edit, and shell tools are ready without MCP setup.

Is my code kept entirely on my machine?

Your session history and configuration are stored locally. Inference still sends prompts, selected repository context, and tool results to the provider you configure. Optional summaries, Progressive Session Maintenance, and compaction also make provider calls.

Can I undo everything an agent does?

Rewind can fork the conversation and restore captured file-tool changes. It is not a complete worktree backup: shell commands, external edits, unsupported paths, and conflicts limit what it can restore. Keep using version control and backups.

Do I have to use subagents or the extra panels?

No. Subagents are off by default for direct calls and Code Mode. Work with your primary agent, or opt in when you want to delegate a specific task. Panels are optional too. The Summary observer, Progressive Session Maintenance, and Herdr reporting are opt-in.

Where are the detailed guides?

Start with the user guide on GitHub for setup and everyday workflows. The technical reference covers exact settings, integrations, and limits.

Start a session

Follow the
white rabbit.

Open your repository and connect your model. Tell magi-code what you're working on.

Read the getting-started guide
Terminal · Rust 1.99+ & Cargo
# Install the latest release
cargo install magi-code --locked

# Open a repository and start
cd /path/to/your/repository
magi-code

Connect your provider with /login in Mission Control. Setup guide

magi-code can edit files and run commands. Shell guardrails are not an OS-level sandbox.