by amber132
Multi-agent DAG orchestrator for Claude Code and Codex CLI — decompose goals, execute in parallel, converge on results
# Add to your Claude Code skills
git clone https://github.com/amber132/Master-OrchestratorGuides for using ai agents skills like Master-Orchestrator.
Let Claude Code and Codex collaborate on your large-scale coding tasks.
Automatically decompose goals into DAGs, execute tasks in parallel across multiple AI agents, and converge on verified results.
Quick Start | Why Master Orchestrator? | How It Works | Documentation
You're working on a task that's too big for a single AI agent call:
A single claude or codex session gets lost in context, misses dependencies, or produces inconsistent code across files. You end up manually coordinating multiple runs, checking outputs, and stitching results together.
Master Orchestrator turns one natural-language goal into a directed acyclic graph (DAG) of tasks, then executes them with the best AI agent for each phase:
mo do "Add JWT authentication to the Express app with middleware, routes, tests, and API docs"
It automatically:
No comments yet. Be the first to share your thoughts!
| Scenario | Single Agent | Master Orchestrator | |----------|-------------|-------------------| | 5-file refactor | Context overflow, inconsistent edits | DAG decomposition, parallel execution | | Bulk fixes (100+ files) | Sequential, slow, no retry | Simple mode: 16 parallel workers, auto-retry | | Complex feature | Manual coordination of multiple runs | Automatic phase routing, convergence detection | | Mixed tasks | Same model for reasoning and coding | Claude for planning, Codex for execution |
git clone https://github.com/amber132/Master-Orchestrator.git
cd Master-Orchestrator
pip install -e ".[dev]"
Requires Python 3.11+ and at least one of claude or codex on your PATH.
# Let the orchestrator auto-route providers
mo do "Add input validation to all POST endpoints in src/routes/"
# Force a specific provider
mo do --provider codex "Generate unit tests for the UserService class"
# Mix providers by phase — Claude plans, Codex executes, Claude reviews
mo do \
--phase-provider decompose=claude \
--phase-provider execute=codex \
--phase-provider review=claude \
"Refactor the payment module to support multiple currencies"
For hundreds of independent work items (linting, formatting, repetitive edits):
# Scan and execute from a task manifest
mo simple run --manifest tasks.jsonl
# Resume after interruption
mo simple resume
# Retry only failures
mo simple retry
Simple mode runs up to 16 parallel workers with automatic retry, syntax validation, and crash recovery.
┌─────────────────────────────────────────────┐
│ Your Goal (natural language) │
└────────────────────┬────────────────────────┘
│
┌────────────────────▼────────────────────────┐
│ Decompose (Claude) │
│ Goal → DAG of dependent sub-tasks │
└────────────────────┬────────────────────────┘
│
┌──────────────────────────┼──────────────────────────┐
│ │ │
┌─────────▼─────────┐ ┌──────────▼──────────┐ ┌─────────▼─────────┐
│ Task A (Claude) │ │ Task B (Codex) │ │ Task C (Codex) │
│ "Write middleware"│ │ "Write routes" │ │ "Write tests" │
└─────────┬─────────┘ └──────────┬──────────┘ └─────────┬─────────┘
│ │ │
└──────────────────────────┼──────────────────────────┘
│
┌────────────────────▼────────────────────────┐
│ Review (Claude) │
│ Cross-agent verification & quality gate │
└────────────────────┬────────────────────────┘
│
┌────────────────────▼────────────────────────┐
│ Converge │
│ Merge results, run tests, verify output │
└─────────────────────────────────────────────┘
Each phase of the pipeline can use a different AI agent:
| Phase | Default Provider | Why |
|-------|-----------------|-----|
| decompose | Claude | Better at planning and dependency analysis |
| execute | Codex | Faster for code generation |
| review | Claude | Better at reasoning about correctness |
| discover | Claude | Better at research and exploration |
| simple | Codex | Optimized for high-throughput bulk tasks |
Override at any level:
# Global override
mo do --provider claude "..."
# Per-phase override
mo do --phase-provider execute=codex --phase-provider review=claude "..."
# Config file (config.toml)
[routing.phase_defaults]
execute = "codex"
review = "claude"
The orchestrator classifies errors and applies appropriate strategies:
The system monitors for:
master_orchestrator/
├── orchestrator.py # Core DAG execution engine
├── autonomous.py # Goal-driven autonomous controller
├── claude_cli.py # Claude Code integration
├── codex_cli.py # Codex CLI integration
├── simple_runtime.py # High-throughput bulk execution
├── config.py # TOML configuration management
├── store.py # SQLite state persistence
├── scheduler.py # DAG-aware task scheduling
├── convergence.py # Quality convergence detection
├── error_classifier.py # Intelligent error categorization
├── self_improve.py # Self-improvement loop
└── cli.py # Unified CLI surface
# config.toml
[orchestrator]
max_parallel = 150
[claude]
default_model = "sonnet"
default_timeout = 1800
max_budget_usd = 1000.0
[codex]
default_model = "gpt-5.4"
default_timeout = 1800
execution_security_mode = "restricted"
[routing]
default_provider = "auto"
auto_fallback = true
[routing.phase_defaults]
decompose = "claude"
execute = "codex"
review = "claude"
See config.toml for a complete example.
| Document | Description | |----------|-------------| | USAGE.md | Complete usage guide with examples | | CLI Reference | All commands and options | | Providers & Routing | Provider configuration deep-dive | | Simple Mode | High-throughput bulk execution | | Simple Validation | Validation pipeline configuration |
Feature Development
mo do "Add real-time notifications using WebSocket — include server, client, reconnection logic, and tests"
Codebase Migration
mo do --phase-provider execute=codex "Migrate all class components to functional components with hooks in src/components/"
Bulk Fixes
mo simple run --manifest lint-fixes.jsonl
Self-Improvement
mo improve -d ./my-project --discover
See CONTRIBUTING.md for guidelines.
If Master Orchestrator helps you ship faster, give it a star!