{"slug": "mlx-code-a-coding-agent-that-speaks-git-natively", "title": "Mlx-Code: A Coding Agent That Speaks Git Natively", "summary": "Mlx-Code, a new coding agent, natively integrates Git as its core state machine, enabling developers to branch, diff, and resume from any checkpoint. By mapping the reasoning loop onto Git mechanisms, it allows isolated worktrees, concurrent multi-agent execution, and recursive sub-agent spawning. The tool supports multiple APIs and can be used as a library for custom workflows.", "body_md": "[ 00_mlx_code ]\n\n# > A Coding Agent That Speaks Git Natively\n\n✔ Git isn't just a backup. It's a state machine.\n\n✔ Git commits store file changes together with the conversation that produced them.\n\n✔ Parallel worktrees host multiple isolated agents concurrently.\n\n✔ Agents can spawn sub-agents recursively.\n\n# Branch, diff, and resume from any branching paths dynamically.\n\n[ 01_cli_demo ]\n\n[ 02_why_git ]\n\n| Agent | Git | What It Enables |\n|---|---|---|\n| Execution step changes files | commit | Inspect changes cleanly with `git diff` |\n| Alternative approach | branch | Explore paths non-destructively |\n| Isolated agent sandbox | worktree | Keep your active checkout clean and safe |\n| Resuming from a past session | checkout | Rewind agent to any snapshot state |\n\nMost agents treat version control as an afterthought.\n**mlx-code** maps the reasoning loop directly onto Git mechanisms. Your complete agent state history lives inside `git commit`\n\nhistory rather than an opaque database.\n\n[ 03_primitives ]\n\nFork from any checkpoint\n\nA branch opens a fresh interactive tab in an isolated worktree.\nTest divergent code designs securely without abandoning your active checkout.\n\n/branch --rev 2 make it use httpx instead\n\nResume from anywhere\n\nEvery file-changing step is snapshot-committed with the chat/execution history.\nRewind cleanly to any checkpoints.\n\nmlc --resume abc1234\n\nSwitch configs on the fly\n\nSwap agent configurations mid-session between planner, coder, and reviewer roles without losing your active context.\n\n/clear --config reviewer.yaml\n\nConcurrent multi-agent\n\nRun multiple agents concurrently inside one batch step.\nShare your unified memory architecture compute pools dynamically.\n\nmlc --engine batch\n\n[ 04_architecture ]\n\n```\nWorktrees:\n\n  main ──●──●──●──●──●──●──●──●──●──●──●──●──●──●──────► Node = git commit + chat history\n            │        │\n            │        └── branch-1 ──●──●──●\n            │                          │ ┌────────────┐\n            │                          └─┤ branch-1-0 ├──●──●\n            │                            └─────┬──────┘\n            └── branch-0 ──●──●──●             │\n                                               │\nTabs:                                          ├────────────► Tab = git branch + Agent\n                                               │\n┌──────────────────────────────────────────────┼─────────┐\n│  TUI tabs                                    │         │\n│  ┌──────┐  ┌──────────┐  ┌──────────┐  ┌─────┴──────┐  │\n│  │ main │  │ branch-0 │  │ branch-1 │  │ branch-1-0 │  │\n│  └──────┘  └────┬─────┘  └──────────┘  └────────────┘  │\n└─────────────────┼──────────────────────────────────────┘\n                  │\nAgents:           ├──────────────────────────────────────► Each tab runs its own Agent\n                  │\n             ┌────┴─────────────────────────────────────┐\n             │  Agent                                   │\n             │  ┌────────────────┐  ┌────────────────┐  │\n             │  │ API:           │  │ Tools:         │  │\n             │  │ Local (mlx-lm) │  │ Read    Write  │  │\n             │  │ Gemini         │  │ Edit    Bash   │  │\n             │  │ Claude         │  │ Grep    Find   │  │\n             │  │ Codex          │  │ Ls      Skill  │  │\n             │  │ DeepSeek       │  │ Agent ─────────┼──┼─► Recursively spawns sub-Agents\n             │  └────────────────┘  └────────────────┘  │\n             │  Git worktree                            │\n             │  (isolation + session state)             │\n             └──────────────────────────────────────────┘\n```\n\n[ 05_library_api ]\n\n### Use as a Library\n\nConstruct custom workflow pipelines, run programmatic background review checks, or coordinate distributed multi-agent workflows natively on your Mac.\n\n``` python\nfrom mlx_code.repl import Agent\nfrom mlx_code.tools import ReadTool, WriteTool, EditTool\n\n                    agent = Agent(api='claude', tool_names=['Read', 'Write', 'Edit'])\n                    result = await agent.run('refactor utils.py to use dataclasses')\n```\n\n[ 06_user_manual ]\n\nslash commands\n\n/branch [--rev N]Fork tab from checkpoint\n\n/diff [--all]Review worktree changes\n\n/clear [--config F]Clear / reset session\n\n/history [--raw]Show chat log\n\n/toolsList active tools\n\n!commandRun a shell command\n\n$commandRun an interactive command\n\nkeyboard shortcuts\n\nCtrl-1 … Ctrl-9Jump directly to N-th tab\n\nCtrl-, / Ctrl-.Cycle adjacent tabs\n\nEnterSubmit\n\nCtrl-JInsert newline\n\nCtrl-RRecall last prompt\n\nCtrl-CClear input or abort agent\n\nCtrl-DClose branch tab, or exit app", "url": "https://wpnews.pro/news/mlx-code-a-coding-agent-that-speaks-git-natively", "canonical_source": "https://www.mlx-code.com/", "published_at": "2026-06-17 07:32:19+00:00", "updated_at": "2026-06-17 07:53:23.916111+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "large-language-models", "generative-ai"], "entities": ["Mlx-Code", "Git", "mlx-lm", "Gemini", "Claude", "Codex", "DeepSeek"], "alternates": {"html": "https://wpnews.pro/news/mlx-code-a-coding-agent-that-speaks-git-natively", "markdown": "https://wpnews.pro/news/mlx-code-a-coding-agent-that-speaks-git-natively.md", "text": "https://wpnews.pro/news/mlx-code-a-coding-agent-that-speaks-git-natively.txt", "jsonld": "https://wpnews.pro/news/mlx-code-a-coding-agent-that-speaks-git-natively.jsonld"}}