Skip to main content

Orchestrate swarms of Claude subagents with natural language

Project description

MAOS - Multi-Agent Orchestration System v0.6.1

CORRECTLY orchestrates Claude Code subagents using the official subagent architecture!

๐Ÿ”ฅ CRITICAL FIX in v0.6.1

  • v0.6.0 had wrong imports - was still using old process spawning
  • v0.6.1 ACTUALLY creates subagent files in .claude/agents/
  • Now properly uses the v3 components with subagent creation

๐Ÿšจ BREAKING CHANGE in v0.6.x

MAOS now works with Claude Code's actual subagent system:

  • โœ… Creates subagent definition files in .claude/agents/
  • โœ… Uses Task tool delegation instead of spawning CLI processes
  • โœ… Claude Code handles execution internally
  • โœ… True parallel execution through Claude's native system
  • โœ… No more subprocess errors - works as intended!

How It Actually Works Now

  1. You describe your task โ†’ "Analyze this codebase and write tests"
  2. MAOS creates subagent files โ†’ .claude/agents/analyzer.md, .claude/agents/tester.md
  3. MAOS provides delegation prompts โ†’ "Use the analyzer subagent to..."
  4. You execute with Task tool โ†’ Claude Code runs subagents in parallel
  5. Results tracked in database โ†’ Full persistence and memory

๐Ÿš€ What's New in v0.6.0

Complete Architecture Rewrite:

  • โœ… Proper Subagent Creation - Creates .claude/agents/*.md files with YAML frontmatter
  • โœ… Task Tool Integration - Generates delegation prompts for Claude Code
  • โœ… No Process Spawning - Uses Claude's native subagent system
  • โœ… Parallel Execution Works - Claude Code handles parallel tasks internally
  • โœ… Database Tracking - Still tracks everything in SQLite
  • โœ… Clean Architecture - Aligns with official Claude Code documentation

๐Ÿ“ฆ Previous v0.4.0

Enhanced Task Understanding & Visibility:

  • โœ… Smart Task Decomposition - Correctly parses explicit agent requests like "use 2 agents, one which understand requirements"
  • โœ… Explainable AI - Shows task understanding and explains decomposition decisions
  • โœ… Real-time Monitoring - Live progress updates for each agent during batch execution
  • โœ… Better Timeout Handling - Detects stuck agents and provides clear timeout messages
  • โœ… Enhanced Database Logging - All tasks and operations properly saved to database
  • โœ… Improved Error Messages - Clear visibility into what each agent is doing

๐Ÿ“ฆ Previous v0.3.2

Bug Fix Release:

  • โœ… Fixed foreign key constraint issue in message bus
  • โœ… Agents now properly created in database before messaging
  • โœ… Prevents duplicate agent creation in database

๐Ÿ“ฆ What's New in v0.3.1

Bug Fix Release:

  • โœ… Fixed SQLite Row conversion issue for Python 3.13 compatibility
  • โœ… Proper dictionary conversion from aiosqlite Row objects
  • โœ… All database queries now return proper dictionaries

๐Ÿ“ฆ What's New in v0.3.0

Complete Orchestration System:

  • โœ… SQLite Persistence - All data stored in a robust database
  • โœ… Task Decomposition - Automatically breaks tasks into parallel subtasks
  • โœ… Session Management - Resume conversations, save/restore checkpoints
  • โœ… Inter-Agent Communication - Agents coordinate and share information
  • โœ… Smart Agent Allocation - Reuses existing agents when possible
  • โœ… Real SDK Mode - Spawns Claude with -p for actual task execution

What MAOS Does

MAOS orchestrates multiple Claude CLI instances to work on complex tasks in parallel:

User: "Implement the requirements in prd.md"

MAOS:
โ”œโ”€ Analyzes requirements
โ”œโ”€ Decomposes into subtasks
โ”œโ”€ Allocates agents (creates new or reuses existing)
โ”œโ”€ Executes tasks in parallel batches
โ””โ”€ Coordinates inter-agent communication

Installation

# Install with pipx (recommended)
pipx install maos-cli

# Or with pip
pip install maos-cli

Quick Start

1. Basic Chat Interface

# Start the orchestrator
maos chat

# Now use natural language
MAOS> Build a REST API with authentication

2. How It Works

When you give MAOS a task, it:

  1. Decomposes - Breaks your request into parallel subtasks
  2. Proposes Agents - Shows which agents it will create/reuse
  3. Gets Approval - You approve the execution plan
  4. Executes - Spawns Claude processes in SDK mode
  5. Coordinates - Manages inter-agent communication
  6. Reports - Shows progress and results

3. Example Session

MAOS> Implement the requirements in prd.md

Analyzing request and creating task plan...
Determining agent allocation...

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
              Agent Allocation
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Agent allocation proposal:
  โ€ข Creating 3 new agents
  โ€ข Reusing 2 existing agents

  NEW: architect-a3f2b1c8 (architect)
    โ†’ Design system architecture based on PRD
  NEW: developer-b4d5c2e9 (developer)  
    โ†’ Implement backend services according to PRD
  NEW: tester-c6e7d3fa (tester)
    โ†’ Write comprehensive tests for PRD features
  REUSE: security-auditor [session: 4d5e6f7a]
    โ†’ Review for security vulnerabilities
  REUSE: reviewer [session: 8b9c0d1e]
    โ†’ Review code quality and standards
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Estimated duration: 10.0 minutes
Estimated cost: $0.1500

Proceed with this plan? (y/n): y

Starting execution...
Spawning agents...
  โœ“ Spawned architect-a3f2b1c8
  โœ“ Spawned developer-b4d5c2e9
  โœ“ Spawned tester-c6e7d3fa
  โ†ป Resumed security-auditor
  โ†ป Resumed reviewer

Executing batch 1/3
[Working... Agents collaborating]

๐Ÿ’ก architect-a3f2b1c8 discovered: Database schema requires indexing
โš ๏ธ developer-b4d5c2e9 needs from architect-a3f2b1c8: API endpoint specs

Execution complete!

Features

๐Ÿง  Intelligent Task Decomposition

  • Automatically breaks complex tasks into subtasks
  • Identifies dependencies between tasks
  • Groups tasks for parallel execution

๐Ÿค– Smart Agent Management

  • Creates specialized agents for different task types
  • Reuses existing agents when appropriate
  • Manages Claude sessions with SDK mode (claude -p)

๐Ÿ’ฌ Inter-Agent Communication

  • Agents can send messages to each other
  • Broadcast discoveries to all agents
  • Request dependencies from other agents

๐Ÿ’พ Persistence & Checkpoints

  • SQLite database stores all orchestration data
  • Save/restore checkpoints for long-running tasks
  • Resume sessions across multiple days

๐Ÿ“Š Real-Time Monitoring

  • Track agent progress
  • View inter-agent messages
  • Monitor resource usage

Commands

Natural Language

Just type what you want:

  • "Build a REST API with authentication"
  • "Review and optimize my codebase"
  • "Fix all the failing tests"
  • "Implement the requirements in prd.md"

System Commands

  • status - Show current execution status
  • save checkpoint <name> - Save current state
  • restore <name> - Restore from checkpoint
  • list checkpoints - Show available checkpoints
  • pause - Pause execution
  • resume - Resume execution
  • help - Show available commands
  • exit - Stop all agents and exit

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚            Natural Language Input            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           Orchestrator Brain                 โ”‚
โ”‚  โ€ข Task Decomposer                          โ”‚
โ”‚  โ€ข Agent Allocator                          โ”‚
โ”‚  โ€ข Execution Planner                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           Session Manager                    โ”‚
โ”‚  โ€ข Spawn Claude with -p <task>              โ”‚
โ”‚  โ€ข Resume sessions with --resume            โ”‚
โ”‚  โ€ข Manage process lifecycle                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Agent Message Bus                    โ”‚
โ”‚  โ€ข Inter-agent communication                โ”‚
โ”‚  โ€ข Message routing                          โ”‚
โ”‚  โ€ข Discovery broadcasting                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         SQLite Persistence                   โ”‚
โ”‚  โ€ข Agents, Sessions, Tasks                  โ”‚
โ”‚  โ€ข Messages, Checkpoints                    โ”‚
โ”‚  โ€ข Complete relational storage              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Requirements

  • Python 3.11+
  • Claude CLI (optional, for actual execution)
    npm install -g @anthropic-ai/claude-code
    export ANTHROPIC_API_KEY="your-api-key"
    

Advanced Usage

Auto-Approve Mode

Skip manual approval for agent proposals:

maos chat --auto-approve

Custom Database Location

maos chat --db-path /path/to/my/maos.db

Configuration File

Create .maos/config.yaml:

orchestrator:
  max_agents: 20
  auto_approve: false
  
persistence:
  db_path: ./maos.db
  
session:
  max_turns: 10
  timeout: 600

Troubleshooting

Claude CLI Not Found

MAOS works without Claude CLI - it creates agent definition files. To actually run agents, install Claude:

npm install -g @anthropic-ai/claude-code

Database Errors

Delete the database to start fresh:

rm maos.db

Session Issues

List and manage sessions:

MAOS> status
MAOS> list checkpoints
MAOS> restore <checkpoint-name>

Examples

Code Review

MAOS> Review all Python files for security issues and performance problems

[Creates security-auditor and performance-optimizer agents]
[Runs them in parallel across your codebase]
[Reports findings with specific file locations]

Test Generation

MAOS> Generate comprehensive tests for all modules

[Creates multiple tester agents]
[Each handles different modules in parallel]
[Produces test files with high coverage]

Documentation

MAOS> Document all public APIs and create a user guide

[Creates documentation-writer agents]
[Analyzes code and generates docs]
[Produces markdown documentation]

Version History

  • v0.3.2 - Fixed foreign key constraint issue in message bus
  • v0.3.1 - Fixed SQLite Row conversion for Python 3.13 compatibility
  • v0.3.0 - Complete orchestration with SQLite, parallel execution, checkpoints
  • v0.2.6 - Fixed agent spawning, improved natural language
  • v0.2.0 - Added Claude CLI integration
  • v0.1.0 - Initial release with agent definitions

Contributing

PRs welcome! Check out our contribution guidelines.

License

MIT - See LICENSE file

Support


Built with โค๏ธ for the AI orchestration community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maos_cli-0.6.1.tar.gz (949.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maos_cli-0.6.1-py3-none-any.whl (262.3 kB view details)

Uploaded Python 3

File details

Details for the file maos_cli-0.6.1.tar.gz.

File metadata

  • Download URL: maos_cli-0.6.1.tar.gz
  • Upload date:
  • Size: 949.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for maos_cli-0.6.1.tar.gz
Algorithm Hash digest
SHA256 46144a6b00b38a6a2a2ce09c22cdc853b167288f3b6573fd52e86c4f80ae12a3
MD5 419061d4c8bf021322b0c86887d22f15
BLAKE2b-256 c8ce3794d5ed0d4f7ffe61106445e58ab5f13ea66f948ddbc92b52c773088242

See more details on using hashes here.

File details

Details for the file maos_cli-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: maos_cli-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 262.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for maos_cli-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e803aaafcfac36f091b9195ef05d512e621e393173d78e2020a4777888c064d8
MD5 d2e7f17bc1aaee4f95aadc59099a7a5d
BLAKE2b-256 3cce1a95cddb68102d72473a7f20fb664b6fcbd9e201a0fb96d11b6f44c917ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page