Building a Custom AI Coding Assistant by Orchestrating Multiple CLIs

Research summary on multi-CLI agent orchestration: patterns, tooling, and real-world results.

A research summary on multi-CLI agent orchestration: patterns, tooling, and real-world results.


1. The Idea

Rather than forcing a single AI coding tool (Claude Code, Codex CLI, Gemini CLI, OpenCode) to do everything, developers can run several of them side-by-side, each in an isolated workspace, with a supervisor — human or AI — that decomposes work, dispatches tasks, and reviews results.

You cannot mix plugins across these tools directly, but you can combine their strengths through:

  1. Shared configurations & workflows — unified config repos and cross-CLI workflow projects
  2. Cross-CLI orchestration — agents take different roles and collaborate on complex tasks
  3. Concept mapping & migration — converting plugins/skills between ecosystems (e.g., wshobson/agents generates native artifacts for Codex CLI, OpenCode, Gemini CLI, Cursor, Copilot, and Claude Code from one Markdown source: 94 plugins, 203 agents, 175 skills, 109 commands)

Since early 2026, running multiple AI coding CLIs in parallel has crystallized into a recognized practice the community calls “agentmaxxing”.


2. The Core Pattern

The classic workflow has four steps:

  1. Decompose — break work into independent, parallelizable tasks with clear file boundaries
  2. Launch — start agents in isolated workspaces (git worktrees) with focused prompts
  3. Review — inspect output as each agent completes
  4. Merge — integrate completed branches into main

The fundamental isolation primitive is git worktree — each agent gets its own branch, directory, and terminal session sharing the same object store, so agents never touch each other’s files.

The critical constraint: if Agent B needs something Agent A hasn’t created yet, they cannot run in parallel. Task decomposition quality determines the ROI.

The developer’s role inverts: from writing code to decomposing work, dispatching agents, and reviewing output — a “compound engineering” model where planning and review dominate.


3. Real-World Use Cases

Parallel feature development

Decompose a feature into independent tasks (e.g., auth API, settings UI, DB migration) and launch one agent per worktree. incident.io runs 4–5 concurrent Claude agents; a UI editor took 10 minutes instead of ~2 hours, with an 18% build speed improvement.

Multi-model code review

The same PR gets reviewed in parallel by different agents that catch different things:

ReviewerStrength
CodexEdge cases, logic errors, race conditions — lowest false-positive rate
GeminiSecurity issues, scalability problems — free tier
ClaudeArchitectural concerns — validates what others flag

Cost-tiered task routing

Match the agent to the task economics:

ToolBest forCost profile
Claude CodeComplex reasoning-heavy refactors$10–30/day via API
Codex CLIRoutine development, fast iterations$5–15/day via API
Gemini CLISimple prompts, light workFree tier (1,000 req/day)

Council / consensus

Ask all configured agents the same question in parallel, then let a “chairman” agent synthesize a conclusion — inspired by Karpathy’s LLM Council, but using your installed CLIs instead of direct API calls (no additional API costs).

Cadence-team pipelines

JSON-driven workflows where Gemini, Codex, and Claude each handle designated phases of a development pipeline (e.g., catlog22/Claude-Code-Workflow).


4. Design Patterns (What the Tools Converge On)

  1. Supervisor / Chief-of-Staff pattern — one agent (or the human) holds business context, routes tasks, monitors progress, and only escalates to the human. Workers stay focused on code. (CLI Agent Orchestrator, EloPhanto)

  2. Worktree isolation — one git worktree per agent; the standard anti-conflict primitive. (parallel-code, worktrunk, agent-cli)

  3. Adversarial cross-model review — the writer is always reviewed by a different model; orchestrators validate independently and never trust subagent self-reports. (metaswarm)

  4. Parallel review gates — independent specialist reviewers run concurrently (e.g., 5-agent design review: PM, Architect, Designer, Security, CTO) with an iteration cap before human escalation. (metaswarm)

  5. Context broker / daemon pattern — persistent background daemons per model keep context alive, cutting prompt size from 5,000–20,000 tokens to 50–200 tokens per call; agents can delegate sub-tasks cross-model (Codex delegating to OpenCode). (claude_code_bridge)

  6. Message-bus coordination — agents coordinate via a SQLite message system + FIFO merge queue with tiered conflict resolution and a watchdog fleet monitor. (Overstory)

  7. Three-tier orchestration (Addy Osmani) — orchestrate at three levels simultaneously:

    • In-process: subagents within a single session (Codex max_threads=6)
    • Local parallel: independent CLI processes in worktrees
    • Cloud async: fire-and-forget (codex cloud exec) — Codex Cloud tasks consume no local resources, enabling 3 local Claude instances + 4 Codex Cloud tasks = 7-way parallelism
  8. Knowledge-driven development — a git-native knowledge base of patterns/gotchas, primed selectively before each task (bd prime --files ... --keywords ...), so agents get relevant lessons without bloating context. (metaswarm, BEADS)


5. Key Numbers & Honest Caveats

  • Optimal concurrency: 5–7 agents on modern hardware — before human review bandwidth becomes the bottleneck
  • Multi-agent coordination: +81% gains on parallelizable tasks, but −70% degradation on sequential work
  • Overhead: 5–10 minutes setup; tasks under ~15 minutes of sequential time have negative ROI
  • Cost multiplies: three agents running simultaneously triple token consumption
  • DORA 2025: 90% AI adoption correlated with +9% bug rates, +91% code review time, +154% PR size — parallel agents concentrate, not eliminate, the review requirement
  • Overstory’s README warning: “compounding error rates, cost amplification, debugging complexity, and merge conflicts are the normal case, not edge cases”
  • Most honest framing: the benefit isn’t raw speed — it’s clarity (named tasks, visible branches, reviewable diffs)

6. The Tooling Landscape (GitHub Repos)

ToolWhat it doesPattern
awslabs/cli-agent-orchestrator (969★)Local server + supervisor delegates to specialist CLIs (Claude, Codex, Gemini, OpenCode, Cursor, Copilot, Hermes, Kimi, Antigravity) in tmux sessions; Web UI, flows, memory, tool restrictionsSupervisor
dsifry/metaswarm (370★)18 agents, 9-phase SDLC, IMPLEMENT→VALIDATE→ADVERSARIAL REVIEW→COMMIT, quality gates, self-learning knowledge baseSwarm + gates
0xwilliamortiz/agents-council (295★)Parallel opinions from Codex/Gemini/etc., chairman synthesis; npx installable skillCouncil
johannesjo/parallel-code (~512★)Electron desktop app: one worktree per task panel, runs all 3 CLIs natively, built-in diff viewerWorktree isolation
bfly123/claude_code_bridge (~2.1k★)Persistent per-model daemons, ~50–200 token context carry-over, cross-model delegationContext broker
jayminwest/overstorySQLite message bus + FIFO merge queue + tiered watchdog; 11 runtime adaptersMailbox
generalaction/emdash (YC W26)23 CLI providers, Linear/GitHub/Jira ticket intake, Plan Mode safety gateProvider-agnostic fleet
josstei/maestro-orchestrateSpecialist personas; classifies tasks into Express vs 4-phase workflowsWorkflow classifier
max-sixty/worktrunkWorktree lifecycle CLI (wt new/switch/list), hooks for auto-setupWorktree manager
basnijholt/agent-cliOne-command bootstrap: worktree + deps + env + launch (~4s)Bootstrapper
catlog22/Claude-Code-Workflow (2.1k★, archived)JSON-driven cadence-team workflows across CLIsPipeline
wshobson/agents (38.4k★)Cross-platform marketplace: 94 plugins / 203 agents / 175 skills / 109 commands for 6 harnessesCross-harness

Related foundations: karpathy/llm-council (the council idea), steveyegge/beads (git-native task tracking), obra/superpowers (agentic skills methodology).


7. Getting Started

  1. Start single: get comfortable with one CLI (e.g., Claude Code or Codex) and its native subagents first.
  2. Add worktree discipline: adopt git worktree or a tool like Worktrunk so agents never share state.
  3. Install a marketplace like wshobson/agents for cross-CLI plugins/skills.
  4. Try orchestration: uv tool install cli-agent-orchestrator (CAO) for supervisor-based delegation, or metaswarm’s /start-task for full SDLC workflow.
  5. Route by economics: Claude for hard refactors, Codex for routine, Gemini for simple tasks.
  6. Keep the human in the loop: review everything; parallel agents concentrate cognitive load.

References

Repos

Blog posts