Lesson 8: Building a Multi‑Agent Orchestration Toolchain with cmux, superpowers, and OpenClaw

This lesson walks through configuring the cmux session manager, the superpowers skill‑sharing layer, and the OpenClaw orchestration engine to enable multiple AI agents to work in parallel, avoid serial bottlenecks, and coordinate their outputs through isolated worktrees and unified reporting.

AI Digital Ideal
AI Digital Ideal
AI Digital Ideal
Lesson 8: Building a Multi‑Agent Orchestration Toolchain with cmux, superpowers, and OpenClaw

This lesson focuses on configuring the three‑tool chain—cmux, superpowers, and OpenClaw—to enable multiple AI agents to run in parallel without interfering with each other.

Core skill : Multi‑Agent parallel orchestration (≈40 minutes, advanced level, prerequisite: Lesson 0007 – CI/CD full loop).

Why move to multi‑Agent orchestration?

Lesson 0003 introduced a single‑Agent TDD loop (implementer → reviewer → implementer …). Its limitations are:

Serial waiting : the reviewer is idle while the implementer writes code.

Context competition : long conversations cause token explosion and performance degradation.

Capability ceiling : a single agent cannot master both API design and database optimization.

Multi‑Agent orchestration splits work among specialized agents and runs them in parallel:

┌─ Agent A (implementer‑tasks)  ──→ execute tasks.md
├─ Agent B (implementer‑auth)   ──→ implement auth features
└─ Agent C (reviewer)         ──→ aggregate and review code

Three‑tool overview

cmux – a tmux‑based session manager that wraps complex tmux commands into simple sub‑commands, giving each agent its own tmux session.

superpowers – Anthropic’s skill‑sharing layer that defines a standard Agent Skill format reusable across different harnesses (Claude Code, OpenClaw, Codex).

OpenClaw – a multi‑Agent orchestration engine that runs agents in isolated git worktrees, coordinates them, and merges their PRs.

cmux: tmux session wrapper

cmux (by yudong.cai) simplifies tmux commands. Example commands:

# Install
pip install cmux
# Create a new Agent session
cmux new implementer-auth "Focus on auth implementation"
# List all sessions
cmux list
# Attach to a session
cmux attach implementer-auth
# Send a command without attaching
cmux send implementer-auth "write unit tests"
# Kill a session
cmux kill implementer-auth

Configuration ( ~/.cmux/config.yaml) can set default shell, worktree base, notifications, and two‑column layouts:

sessions:
  default_shell: bash
  worktree_base: ~/projects
notifications:
  enabled: true
  on_completion: true
layouts:
  two_column:
    left: implementer
    right: reviewer

superpowers: cross‑harness skill framework

superpowers standardises an Agent Skill so the same definition can run in Claude Code, OpenClaw, or Codex.

Skill directory layout:

skills/
├── _meta.yaml      # skill metadata
├── prompt.md       # core instructions
├── examples/
│   └── good.yaml   # positive example
└── references/
    └── api.md      # reference docs

Example _meta.yaml for a TDD loop skill:

name: tdd-loop
version: 1.0.0
description: TDD development loop Agent Skill
author: Loop Engineering Course
harnesses:
  - claude-code
  - openclaw
  - codex
triggers:
  - "开始 TDD"
  - "tdd"
  - "测试驱动"
capabilities:
  - write_tests_first
  - run_tests_after
  - refactor_with_confidence
prompt.md

defines trigger conditions, core process (A3 test writing, C3 implementation, Refactor), safety valves, and output format.

In Claude Code the skill is loaded with:

@skills load tdd-loop
@skills list
@skills unload tdd-loop

Core value: write once, run many across different harnesses.

OpenClaw: multi‑Agent orchestration engine

OpenClaw (by Peter Steinberger) treats agents like independent chefs preparing dishes in separate kitchens, then plating them together.

Worktree isolation : each agent works in its own git worktree, preventing file‑level conflicts.

Leader / Worker : the leader assigns tasks; workers execute and report.

PR merging : workers create PRs that the reviewer merges into main.

Configuration ( openclaw.yaml) example:

version: 1.0
leader:
  harness: claude-code
  prompt: "You are the project leader, coordinating multiple workers."
workers:
  - name: implementer-auth
    harness: codex
    worktree: feature/auth
    prompt: "Focus on JWT authentication."
  - name: implementer-tasks
    harness: codex
    worktree: feature/tasks
    prompt: "Focus on task CRUD implementation."
  - name: reviewer
    harness: claude-code
    prompt: "Review and merge all PRs after workers finish."
merge_strategy:
  sequential: true  # merge one PR after another
require_all_pass: true

Typical workflow:

# Start OpenClaw
openclaw start --config openclaw.yaml
# OpenClaw automatically:
# 1. Creates worktrees feature/auth and feature/tasks
# 2. Starts agents implementer-auth and implementer-tasks in parallel
# 3. Each agent creates a PR when done
# 4. Reviewer agent reviews and merges PRs
# Check status
openclaw status
# Example output
# implementer-auth   ✓ PR created
# implementer-tasks  ✓ PR created
# reviewer           → Reviewing PRs...

Worktree conflict resolution

Worktree isolation prevents agents from stepping on each other’s changes. Visualised:

main ──►
   │          │          │
   ▼          ▼          │
 feature/auth  feature/tasks  │
   │                     │
   └─ reviewer merges ◄───┘

Integration practice: multi‑feature task‑API

Scenario: implement "user authentication" and "task CRUD" in parallel.

cmux unified management
    │
    ├── OpenClaw (Leader) ──→ global coordination
    │       │
    │       ├── Agent A (implementer‑auth) ──→ isolated worktree
    │       │
    │       └── Agent B (implementer‑tasks) ──→ isolated worktree
    │
    └── Reviewer Agent ──→ aggregate review

Startup script ( scripts/multi-agent-start.sh) demonstrates creating cmux sessions, initializing OpenClaw, loading skills, and launching the orchestrator:

#!/bin/bash
# 🚀 Start multi‑Agent environment
cmux new leader "OpenClaw Leader"
cmux new worker-auth "Implementer Auth"
cmux new worker-tasks "Implementer Tasks"
cmux new reviewer "Reviewer"
cd ~/projects/task-api
openclaw init --template=multi-feature
for session in leader worker-auth worker-tasks reviewer; do
    cmux send $session "@skills load tdd-loop"
    cmux send $session "@skills load security-review"
done
cmux send leader "openclaw start --config openclaw.yaml"
echo "✅ Multi‑Agent environment started; run 'cmux list' to view status"

Monitoring and logs

# List all Agent statuses
cmux list
# Capture output of a specific Agent
cmux capture worker-auth
# Tail logs in real time
cmux logs worker-auth -f
# OpenClaw summary report
openclaw report

Typical anti‑patterns

Multiple agents directly modify main – leads to frequent conflicts; solution : use worktree isolation.

All agents share the same prompt – no specialization; solution : assign distinct prompts per capability.

No communication mechanism – duplicated effort and information silos; solution : share state via a Ledger.

No timeout settings – a stalled agent blocks the whole pipeline; solution : configure per‑Agent timeouts.

Key insight

Multi‑Agent orchestration boils down to specialized division + isolated execution + aggregated verification . cmux offers a unified session view, superpowers provides cross‑harness skill standardisation, and OpenClaw delivers worktree isolation and parallel execution. Combined, they upgrade Loop Engineering from a single‑Agent loop to a multi‑Agent team, multiplying efficiency.

References (2025–2026)

cmux GitHub (2026)

superpowers Claude Code (2026)

OpenClaw GitHub (2026)

Git Worktree documentation (2026)

Have questions about cmux configuration, superpowers skill authoring, or OpenClaw worktree conflict handling? Feel free to ask.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

multi-agentparallel executiongit worktreeAI orchestrationOpenClawsuperpowerscmux
AI Digital Ideal
Written by

AI Digital Ideal

Express ideas with code, expand imagination with AI.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.