Skip to content
tr00x edited this page Jun 5, 2026 · 8 revisions
Manta — one agent forked into many

Manta

The self-cloning Claude Code pattern

Manta clones you — not a fleet of specialized sub-agents. Same system prompt, your whole conversation inherited, each copy in its own isolated git worktree, all coordinating over a shared bus.

license version Claude Code bus

Note

Every other multi-agent framework builds a team of roles — a planner, a coder, a critic, each with its own prompt and its own blind spots. Manta does the opposite: the main agent forks itself. One agent, N hands.

Why Manta is different

Each clone boots warm — it already knows the whole conversation — runs in an isolated git worktree, and coordinates with its siblings over a lock / claim / broadcast bus. No role drift, no context re-explaining, no central scheduler.

Important

You stay the curator: scope the work, observe, review, merge the winner. Clones do the work and disappear cleanly — they commit to their own branch and never push. You pull.

Quick start

# 1) install the plugin (Claude Code)
npx @tr00x/manta@latest install

# 2) health-check your setup
manta doctor                    # Node, claude CLI, the bus MCP, git

# 3) first cast — map a codebase, read-only
manta cast recon-swarm --clones 2 \
  --task "Map auth + billing: entry points, data flow, where to add rate-limiting" \
  --max-files-changed 0 --allowed-paths docs/audits &

manta status                    # STARTING -> WORKING -> DEAD

Tip

A cast is done when every clone is DEAD. Watch with manta status — don't busy-poll. Full walkthrough in Getting-Started.

Cast modes

Pick by the shape of the work, not by inventing roles.

Shape of the task Mode Clones Merges?
Map / understand a codebase (read-only) Recon-Swarm 1–5 No — you read audits
One bug, unknown cause, spans layers Bug-Hunt 1–2 No — a report
The same change across N files/modules Refactor-Wave 2–5 Yes — gated, sequential
Two or more rival approaches, want the best Forking-Realities 2+ Yes — scored, promote one
One risky change, reviewed as it's written Pair-Programming 2 Yes — writer + reviewer
Build a feature and its tests Test-Storm 2–3 Yes — coder + tester + fuzzer
Make docs match the code Documentation-Chase 1+ Docs only
N independent opinions on a hard call Council 3–5 No — you decide
A throwaway draft to react to Decoy 1–2 No — you finish it

How a cast works

flowchart LR
    M([main agent]) -->|fork transcript| A[clone A · worktree]
    M -->|fork transcript| B[clone B · worktree]
    A <-->|locks · claims · broadcasts| BUS[(manta-bus)]
    B <-->|heartbeats| BUS
    A -->|commit to branch| H{harvest}
    B -->|commit to branch| H
    H -->|review + merge winner| M
Loading
1. Fork Manta copies your live transcript into each clone's worktree, so it boots as a continuation of this conversation (auto-capped for huge sessions).
2. Coordinate Clones share the bus — file locks, a work-claim board, broadcasts, and heartbeats. No two clones touch the same file blindly.
3. Harvest Each clone commits to its own branch and signals its death. You read the deliverable / merge-review and promote the winner. Nothing is pushed for you.

See Cast-Manifest for exactly what a cast writes to disk.

Safety and ergonomics

Warning

Run casts serially unless you know they're isolated — concurrent casts can collide on clone-letter / worktree names. One cast's clones all DEAD before the next.

  • Isolated worktrees — a clone can't touch your working tree or a sibling's.
  • Graceful death — finished clones release locks, write a report, commit, and exit; crashes are reaped with manta recover.
  • Curated MCP profile — clones boot with manta-bus plus your light servers; heavy LSP/indexers are filtered so boot stays fast.
  • One stop buttonmanta abort marks every live clone DEAD.

Ecosystem

This wiki mirrors the user docs shipped in the plugin (docs/user/). Source of truth: the repository.

Clone this wiki locally