Do not spend any money on a bankrbot SWARM token.
A disciplined tmux-based agent orchestration platform that turns swarms of AI agents into reliable, professional software engineers.
SwarmForge is an agent coordination system that facilitates communication between agents working in different git worktrees.
It provides a shared structure for role-specific prompts, worktree assignment, tmux sessions, and message passing so multiple agents can collaborate on the same project without stepping on each other.
SwarmForge is a lightweight, tmux-based orchestration layer that:
- Launches a config-driven swarm from a project-local
swarmforge/swarmforge.conf - Creates one tmux session and one Terminal window per configured role
- Reads behavior from project-local
swarmforge/<role>.promptfiles plus a layeredswarmforge/constitution.prompt - Supports per-role backends such as
claude,codex,copilot, orgrok - Creates a project-local
swarmtools/directory with notification helpers for the active swarm - Creates one git worktree per configured role under
.worktrees/ - Initializes a git repository in a new working directory and creates a first commit with
logs/andagent_context/ignored - Keeps all swarm state local to the working directory in
.swarmforge/
- Config-Driven Topology — The swarm shape comes from
swarmforge/swarmforge.conf, not hardcoded shell variables. - Project-Local Roles — Each role is defined by
swarmforge/<role>.promptin the working tree being orchestrated. - Layered Constitution —
swarmforge/constitution.promptcan delegate to subordinate files such asswarmforge/constitution/project.prompt,engineering.prompt, andworkflow.prompt. - Backend Selection Per Role — A role can launch
claude,codex,copilot, orgrok. - Observable Swarm — Open one Terminal window per role and watch the sessions in real time.
- Self-Hosted & Lightweight — Runs locally in tmux and Terminal with minimal machinery.
In a configuration with an architect, coder, and reviewer, the recommended prompt layout is:
swarmforge/
swarmforge.conf
constitution.prompt
constitution/
project.prompt
engineering.prompt
workflow.prompt
architect.prompt
coder.prompt
reviewer.prompt
constitution.prompt is the entry point. It can define precedence and direct agents to read subordinate constitution files in order. That lets you separate project-specific rules from engineering rules and workflow rules without forcing everything into one large prompt.
The default three-agent workflow is:
architectdefines behavior, plans, and acceptance-level intentcoderimplements one small slice at a time and hands off completed workreviewerperforms deeper verification and quality checks before final handoff
- Create a
swarmforge/directory in the target working directory. - Put
swarmforge.conf,constitution.prompt, and one<role>.promptfile per configured role inside it. If needed, add subordinate files underswarmforge/constitution/. - In
swarmforge/swarmforge.conf, define each window aswindow <role> <agent> <worktree>. - Add
swarmforge.shto your shellPATHbefore startup. - Run
swarmforge.sh <working-directory>or run it from inside that directory. - If the working directory is not already a git repo, startup runs
git init, renames the initial branch tomaster, writes.gitignoreentries for.swarmforge/,.worktrees/,swarmtools/,logs/, andagent_context/, and makes the first commit from the current project state. - Startup creates a git worktree for each window under
.worktrees/<worktree>, unless the worktree field isnoneormaster. - Startup creates
swarmtools/notify-agent.shfor that project. - SwarmForge creates tmux sessions, opens Terminal windows, and launches each configured backend in its assigned worktree.
- Roles communicate through helper commands such as
notify-agent.sh <role> --file <message-file>.
swarmforge/swarmforge.conf defines the swarm window-by-window. Each line has this form:
window <role> <agent> <worktree>
You can define as many windows as your project needs. Each role maps to a corresponding prompt file at swarmforge/<role>.prompt, so a config containing architect, coder, reviewer, research, and release windows would expect:
swarmforge/architect.promptswarmforge/coder.promptswarmforge/reviewer.promptswarmforge/research.promptswarmforge/release.prompt
This lets each project choose its own swarm shape instead of being locked to a fixed set of roles.
The first window in the config is the cleanup window. SwarmForge attaches shutdown cleanup to that window's launch command and falls back to that tmux session when no trackable terminal backend is available.
When SwarmForge opens trackable terminal windows or tabs, it also starts a small window watchdog:
- Closing a non-cleanup terminal surface reopens that surface attached to the same tmux session.
- Closing the cleanup terminal surface shuts down all configured tmux sessions and closes the remaining tracked surfaces.
- The watchdog updates
.swarmforge/window-idswhen it reopens a window so shutdown cleanup still targets the current windows.
SwarmForge uses a project-specific tmux socket recorded in .swarmforge/tmux-socket, so each project swarm is isolated from other tmux sessions. It also honors tmux base-index and pane-base-index settings when launching agents and sending notifications, so configurations that number windows or panes from 1 work without requiring users to change their tmux preferences.
SwarmForge opens trackable terminal windows or tabs through a small terminal backend adapter.
Default detection:
- If AppleScript is available, SwarmForge opens macOS Terminal.app windows.
- Otherwise, if
wt.exeis available, SwarmForge opens Windows Terminal windows. - Otherwise, SwarmForge attaches the cleanup tmux session in the current shell.
Set SWARMFORGE_TERMINAL to override detection:
SWARMFORGE_TERMINAL=ghostty ./swarm
SWARMFORGE_TERMINAL=terminal-app ./swarm
SWARMFORGE_TERMINAL=windows-terminal ./swarm
SWARMFORGE_TERMINAL=none ./swarmUse ghostty when you want SwarmForge to open Ghostty tabs instead of the default Terminal.app windows.
Use windows-terminal when you want SwarmForge to open Windows Terminal windows from WSL.
Use none when you want SwarmForge to skip terminal automation and attach the cleanup tmux session in the current shell.
Terminal backends live in terminal-adapters/. To add a new backend, create one file named after the backend:
terminal-adapters/wezterm.sh
The file must define this small contract:
terminal_backend_label() {
echo "WezTerm"
}
terminal_backend_can_open_sessions() {
return 0
}
terminal_backend_tracks_windows() {
return 0
}
terminal_open_session() {
local session="$1"
local title="$2"
local sibling_id="${3:-}"
# Open a terminal surface that runs:
# cd "$WORKING_DIR" && exec tmux -S "$TMUX_SOCKET" attach-session -t "$session"
#
# Print a stable window/tab id to stdout.
}
terminal_window_exists() {
local window_id="$1"
# Return 0 if the id from terminal_open_session still exists.
# Return nonzero otherwise.
}
terminal_close_window() {
local window_id="$1"
# Close the id from terminal_open_session.
}Then run SwarmForge with the backend name:
SWARMFORGE_TERMINAL=wezterm ./swarmIf the terminal can open sessions but cannot return stable ids for open/check/close, keep terminal_backend_can_open_sessions as return 0 and set terminal_backend_tracks_windows to return 1. SwarmForge will open one surface per session and skip the watchdog for that backend. terminal-adapters/windows-terminal.sh is an example of this launch-only style.
If the backend cannot open sessions at all, set both capability functions to return 1; SwarmForge will attach the cleanup tmux session in the current shell. Only edit swarm-terminal-adapter.sh when adding aliases or changing default auto-detection.
Example config:
window coordinator codex master
window coder codex coder
window refactorer codex refactorer
window architect codex architect
In the example above, the agents run in these worktrees:
coordinator-> main working directory onmaster, and is the cleanup window because it is listed firstcoder->.worktrees/coderrefactorer->.worktrees/refactorerarchitect->.worktrees/architect
If a window uses master as its worktree name, SwarmForge does not create .worktrees/master; that role runs in the main working directory on the master branch.
The repository includes example swarm definitions under examples/.
examples/clojureHTW/swarmforge/shows a layered constitution and agent prompts for a Clojure Hunt The Wumpus project, including a queueing rule for messages that arrive while an agent is busy.
Use these example directories as starting points for project-local swarmforge/ folders.
-
In the directory where you want to use SwarmForge, pull the repository contents without creating a Git remote:
curl -L https://github.com/unclebob/swarm-forge/archive/refs/heads/main.tar.gz | tar -xz --strip-components=1
Just type ./swarm. The windows should all pop up.