TopGit
GitHub Repo Review

SwarmForge: Local tmux Orchestrator for AI Agents

unclebob/swarm-forge
STopGit review image for unclebob/swarm-forge
Review by Topgit.dev for unclebob/swarm-forge, with GitHub repository stats and README context.
Quick verdict

SwarmForge is worth setting up if you already run multiple AI coding agents on the same project and are tired of them overwriting each other's edits — it gives each role its own git worktree and routes all communication through a validated handoff file instead of shared terminal chaos. Skip it if you only run one agent at a time, or don't want to hand-write tmux configs, role prompts, and constitution articles just to get a swarm running.

Stars
★ 4.1k
Forks
⑂ 409
Language
Clojure
License
See repository
Topic
—
Updated
Sep 2026
Homepage
—
GitHub

Understanding SwarmForge: A Local AI Agent Orchestrator

SwarmForge is a local, tmux-based orchestration platform that runs several AI coding agents against one git repository, each working in its own git worktree. A project-local swarmforge.conf file decides which roles run and which backend each uses (claude, codex, copilot, or grok), then SwarmForge opens one tmux session and terminal window per role. Agents hand off work through validated files, not raw terminal messages, relayed by a background daemon.

The Challenge of Coordinating AI Agents in Development

Running several AI coding agents on the same project usually means either giving them the same working directory and hoping they don't overwrite each other's edits, or manually copying context between separate chat sessions. SwarmForge addresses this by giving each agent role its own git worktree and a structured handoff protocol, so a coder agent can hand a specific commit to a reviewer agent without either one touching files the other is mid-edit on. The problem isn't that AI agents can't write code — it's that letting several of them write to the same tree at once produces conflicts and lost context, and SwarmForge's answer is process discipline borrowed from software engineering (TDD, Gherkin specs, dedicated review roles) rather than a smarter merge algorithm.

Core Capabilities of SwarmForge

  • ✓Three prebuilt workflow branches — two-pack (a coder/cleaner loop), four-pack (specifier/coder/refactorer/architect), and six-pack (specifier/coder/cleaner/architect/hardener/QA) — each defining a different role pipeline on the same core engine.
  • ✓Git worktree isolation: each configured role runs in its own .worktrees/<role> directory so agents don't collide on the same files.
  • ✓Config-driven topology via swarmforge/swarmforge.conf, where each line maps a role to an agent backend, a worktree, and a receive mode (task or batch).
  • ✓A layered constitution system: a shared constitution.prompt plus per-article files (engineering.prompt, handoffs.prompt, workflow.prompt) that a runnable branch can override with local-*.prompt files.
  • ✓A file-based handoff protocol run by a background daemon (handoffd.bb) via three helper scripts — swarm_handoff.sh, ready_for_next.sh, done_with_current.sh — using two message types, git_handoff and note.
  • ✓Per-role backend selection: any role can launch claude, codex, copilot, or grok as its agent CLI.
  • ✓Sleep prevention while a swarm is running, via caffeinate on macOS or systemd-inhibit on Linux, toggleable with SWARMFORGE_PREVENT_SLEEP=0.
  • ✓Pluggable terminal backends (Terminal.app via AppleScript, Windows Terminal, Ghostty, or none) selected automatically or overridden with SWARMFORGE_TERMINAL.
How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history ↗

Best use cases

  • •Running a strict TDD implementation/refinement loop on a small backend task with two-pack's coder/cleaner pair.
  • •Building a feature that needs upfront Gherkin acceptance specs and architectural review, using four-pack's specifier -> coder -> refactorer -> architect pipeline.
  • •Coordinating a major project where specification, coding, cleanup, architecture, mutation hardening, and QA each need a dedicated agent, via six-pack.
  • •Watching several agents work in real time across separate terminal windows instead of babysitting one chat session at a time.
  • •Standardizing engineering rules (CRAP/DRY review, mutation hardening) across every role through shared constitution articles instead of repeating instructions in each prompt.

Getting Started with SwarmForge

SwarmForge isn't a package you install — you pull one of its runnable branches directly into your project directory. First make sure the machine has zsh, git, tmux, Babashka (bb), and at least one already-configured agent backend (codex, claude, copilot, or grok). Then, from inside the directory you want to orchestrate, pick a branch and pull it without creating a git remote: set BRANCH=two-pack, four-pack, or six-pack and run curl -L "https://github.com/unclebob/swarm-forge/archive/refs/heads/${BRANCH}.tar.gz" | tar -xz --strip-components=1. Don't pull main for this step — main is documentary and holds only the shared scripts and default constitution articles; the runnable branches hold the actual project configuration and role prompts.

Running and Managing Your SwarmForge Agents

Start a swarm by running ./swarm from the project directory. On first run it downloads the main branch archive, copies the shared operational scripts into swarmforge/scripts/, stages the shared constitution articles, and launches swarmforge/scripts/swarmforge.sh; later runs reuse the local scripts directory instead of re-downloading. Terminal windows open automatically, one per configured role, each attached to a project-specific tmux socket. Closing any window other than the first one is non-destructive — a watchdog reopens it and reattaches it to the same tmux session, so agent state and terminal history survive. To stop the whole swarm, close the first window listed in swarmforge.conf; that's the designated cleanup window, and closing it tears down the tmux sessions and closes the remaining tracked windows.

Strengths

  • ✓Three ready-made workflow shapes (two-pack, four-pack, six-pack) cover a small TDD loop up through a six-role pipeline with dedicated QA and hardening, without designing a role graph from scratch.
  • ✓Git worktree isolation plus a file-based handoff protocol means agents don't fight over the same files or need to be manually told what changed.
  • ✓The constitution system lets you set engineering rules once (CRAP/DRY review, mutation hardening) and share them across every role, with local-*.prompt overrides when one branch needs an exception.
  • ✓Backend-agnostic per role: mix claude, codex, copilot, and grok in the same swarm instead of committing to one vendor.
  • ✓Runs entirely locally in tmux with no server component, and the sleep-prevention logic means a long-running swarm won't stop mid-task because the laptop went to sleep.

Considerations When Using SwarmForge

  • △Setup requires Babashka (bb), tmux, zsh, and git all installed and working together, plus at least one agent CLI already configured — closer to assembling a build system than running a single install command.
  • △Terminal automation defaults to macOS Terminal.app via AppleScript or Windows Terminal via wt.exe; on a plain Linux desktop without either, SwarmForge falls back to attaching the cleanup tmux session in the current shell instead of opening one window per role.
  • △Sleep prevention only covers macOS (caffeinate) and Linux (systemd-inhibit, when available) — and the README notes a display lock or manual sleep can still interrupt an active agent.
  • △The main branch itself won't run a swarm — you have to already know to target two-pack, four-pack, or six-pack, which isn't obvious from the repository name alone.
  • △No license is listed among the repository details available for this review, so confirm the terms in the repository's LICENSE file before adopting SwarmForge for commercial work.

Exploring Other AI Agent Orchestration Tools

SwarmForge Frequently Asked Questions

What are the prerequisites for running SwarmForge?

SwarmForge needs zsh, git, tmux, and Babashka (bb) installed on the machine, plus at least one configured AI agent backend such as codex, claude, copilot, or grok. It runs entirely locally, with no server component to set up.

How do SwarmForge agents communicate with each other?

SwarmForge agents don't message each other directly. They write validated handoff files with swarm_handoff.sh, and a background daemon called handoffd.bb copies those files from an agent's outbox into the recipient's inbox and sends a generic wake-up notification.

Can I define custom roles and workflows in SwarmForge?

SwarmForge lets you define custom roles: swarmforge.conf maps any role name to an agent backend, a worktree, and a prompt file at swarmforge/roles/<role>.prompt, so a project isn't limited to the two-pack, four-pack, or six-pack role sets.

How do I stop a SwarmForge swarm?

Close the first window listed in swarmforge.conf — SwarmForge treats it as the cleanup window, and closing it shuts down the tmux sessions and closes every other tracked window for that swarm.

What AI agent backends are supported by SwarmForge?

SwarmForge can launch claude, codex, copilot, or grok as the agent CLI for any given role, chosen per role in swarmforge.conf rather than fixed for the whole swarm.

Does SwarmForge prevent my computer from sleeping during operation?

SwarmForge tries to keep the host awake while a swarm is running, using caffeinate on macOS and systemd-inhibit on Linux when available. A display lock or manual sleep can still interrupt agents, and setting SWARMFORGE_PREVENT_SLEEP=0 before ./swarm disables this behavior entirely.

Who should try it — and who should skip

Reach for SwarmForge if you already run multiple coding agents against the same repository and want that coordination to happen through git worktrees and a validated handoff protocol instead of ad hoc terminal juggling — especially if you like TDD, Gherkin specs, and dedicated review roles being enforced by the workflow itself. Skip it if you work solo with a single agent, don't want to install Babashka and tmux, or need something that runs unattended on a remote server rather than in Terminal windows on your own machine.

Source & attribution

Facts and quotes sourced from the unclebob/swarm-forge GitHub repository and its README.

GitHub data · last synced Aug 11, 2026Reviewed by Henry
← Back to TopGit

Is swarm-forge worth your time?

ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of swarm-forge.

GitHub