[ 00_mlx_code ]
β Git isn't just a backup. It's a state machine.
β Git commits store file changes together with the conversation that produced them.
β Parallel worktrees host multiple isolated agents concurrently.
β Agents can spawn sub-agents recursively.
[ 01_cli_demo ]
[ 02_why_git ]
| Agent | Git | What It Enables |
|---|---|---|
| Execution step changes files | commit | Inspect changes cleanly with git diff |
| Alternative approach | branch | Explore paths non-destructively |
| Isolated agent sandbox | worktree | Keep your active checkout clean and safe |
| Resuming from a past session | checkout | Rewind agent to any snapshot state |
Most agents treat version control as an afterthought.
mlx-code maps the reasoning loop directly onto Git mechanisms. Your complete agent state history lives inside git commit
history rather than an opaque database.
[ 03_primitives ]
Fork from any checkpoint
A branch opens a fresh interactive tab in an isolated worktree. Test divergent code designs securely without abandoning your active checkout.
/branch --rev 2 make it use httpx instead
Resume from anywhere
Every file-changing step is snapshot-committed with the chat/execution history. Rewind cleanly to any checkpoints.
mlc --resume abc1234
Switch configs on the fly
Swap agent configurations mid-session between planner, coder, and reviewer roles without losing your active context.
/clear --config reviewer.yaml
Concurrent multi-agent
Run multiple agents concurrently inside one batch step. Share your unified memory architecture compute pools dynamically.
mlc --engine batch
[ 04_architecture ]
Worktrees:
main βββββββββββββββββββββββββββββββββββββββββββββββββΊ Node = git commit + chat history
β β
β βββ branch-1 βββββββββ
β β ββββββββββββββ
β βββ€ branch-1-0 βββββββ
β βββββββ¬βββββββ
βββ branch-0 βββββββββ β
β
Tabs: ββββββββββββββΊ Tab = git branch + Agent
β
ββββββββββββββββββββββββββββββββββββββββββββββββΌββββββββββ
β TUI tabs β β
β ββββββββ ββββββββββββ ββββββββββββ βββββββ΄βββββββ β
β β main β β branch-0 β β branch-1 β β branch-1-0 β β
β ββββββββ ββββββ¬ββββββ ββββββββββββ ββββββββββββββ β
βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β
Agents: ββββββββββββββββββββββββββββββββββββββββΊ Each tab runs its own Agent
β
ββββββ΄ββββββββββββββββββββββββββββββββββββββ
β Agent β
β ββββββββββββββββββ ββββββββββββββββββ β
β β API: β β Tools: β β
β β Local (mlx-lm) β β Read Write β β
β β Gemini β β Edit Bash β β
β β Claude β β Grep Find β β
β β Codex β β Ls Skill β β
β β DeepSeek β β Agent ββββββββββΌβββΌββΊ Recursively spawns sub-Agents
β ββββββββββββββββββ ββββββββββββββββββ β
β Git worktree β
β (isolation + session state) β
ββββββββββββββββββββββββββββββββββββββββββββ
[ 05_library_api ]
Use as a Library
Construct custom workflow pipelines, run programmatic background review checks, or coordinate distributed multi-agent workflows natively on your Mac.
from mlx_code.repl import Agent
from mlx_code.tools import ReadTool, WriteTool, EditTool
agent = Agent(api='claude', tool_names=['Read', 'Write', 'Edit'])
result = await agent.run('refactor utils.py to use dataclasses')
[ 06_user_manual ]
slash commands
/branch [--rev N]Fork tab from checkpoint
/diff [--all]Review worktree changes
/clear [--config F]Clear / reset session
/history [--raw]Show chat log
/toolsList active tools
!commandRun a shell command
$commandRun an interactive command
keyboard shortcuts
Ctrl-1 β¦ Ctrl-9Jump directly to N-th tab
Ctrl-, / Ctrl-.Cycle adjacent tabs
EnterSubmit
Ctrl-JInsert newline
Ctrl-RRecall last prompt
Ctrl-CClear input or abort agent
Ctrl-DClose branch tab, or exit app