Skip to content

clafollett/maos

Repository files navigation

MAOS - Multi-Agent Orchestration System

A high-performance Rust CLI that enhances Claude Code with parallel AI development capabilities.

What is MAOS?

MAOS is a compiled Rust binary that replaces fragile Python hook scripts with a fast, reliable CLI. It enhances Claude Code's ability to work with multiple AI agents in parallel through automatic workspace isolation and intelligent coordination.

Key Features:

  • πŸš€ Blazing Fast: Target <10ms execution (currently ~50-200ms with Python bootstrap)
  • πŸ”’ Rock Solid: Compiled binary that can't be accidentally broken
  • πŸ“¦ Easy Install: npx @maos/cli or brew install maos (coming soon)
  • πŸ‘» Invisible: Users interact with Claude Code normally

Bootstrap Phase: MAOS currently uses Python scripts to implement all features while we build the Rust CLI. This means you can use MAOS today! The Python implementation in .claude/hooks/ provides full functionality and will be replaced by the maos binary with the same features but better performance.

Quick Start

⚑ See the Quick Start Guide to get running in 5 minutes!

Current Status: Bootstrap Phase (Python Implementation)

MAOS is currently in bootstrap phase - the Python implementation in .claude/hooks/ provides full functionality while we build the Rust CLI.

Use MAOS Today:

  1. Clone this repository
  2. Configure your .claude/settings.json with Python hooks
  3. Full orchestration features work now!

See CONTRIBUTING.md for setup instructions.

Future: Rust CLI Installation (Target: Q3 2025)

When the Rust CLI is released, installation will be simple:

# Via NPX (recommended)
npx @maos/cli setup

# Via Homebrew
brew install maos

# Direct download
curl -sSL https://raw.githubusercontent.com/clafollett/maos/main/scripts/install.sh | sh

The Rust CLI will automatically update your settings.json hooks during installation!

Future Configuration

When complete, update your Claude Code settings.json:

{
  "hooks": {
    "PreToolUse": [{
      "command": "maos pre-tool-use"  // Currently: uv run script.py
    }],
    "PostToolUse": [{
      "command": "maos post-tool-use"
    }]
  }
}

That's it! MAOS now handles all orchestration automatically.

How It Works

  1. User talks to Claude Code: "Build me a complete authentication system"
  2. Claude Code decides to use multiple agents for parallel work
  3. MAOS hooks automatically:
    • Create isolated git worktrees for each agent
    • Prevent file conflicts between agents
    • Track progress and coordinate work
    • Clean up when complete
  4. Results are seamlessly integrated back

No new commands to learn. No complex setup. Just better parallel AI development.

Architecture

User β†’ Claude Code β†’ settings.json β†’ MAOS CLI
                                       ↓
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚   Rust Binary   β”‚
                              β”‚ β€’ Security      β”‚
                              β”‚ β€’ Orchestration β”‚
                              β”‚ β€’ TTS & Notify  β”‚
                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       ↓
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚     Git Worktrees         β”‚
                         β”‚ β€’ backend-engineer/       β”‚
                         β”‚ β€’ frontend-engineer/      β”‚
                         β”‚ β€’ qa-engineer/            β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

CLI Commands

# Core hooks
maos pre-tool-use      # Security checks + orchestration
maos post-tool-use     # Cleanup + logging

# Notifications
maos notify            # Smart TTS notifications
maos stop              # Session end with TTS
maos subagent-stop     # Sub-agent cleanup

# Monitoring
maos prompt-submit     # Log user prompts
maos session-info      # Current session status
maos worktree-list     # Active worktrees

Key Features in Detail

πŸ”’ Security First

  • Blocks dangerous rm -rf commands before execution
  • Prevents access to .env files containing secrets
  • Validates all paths to prevent directory traversal
  • Compiled binary ensures tamper-proof operation

πŸš€ Performance (Target)

  • Written in Rust for maximum speed
  • Zero Python interpreter overhead (when complete)
  • Sub-10ms hook execution (vs current ~50-200ms)
  • Handles hundreds of tool calls efficiently

πŸŽ™οΈ Smart Notifications

  • Multi-provider TTS support (ElevenLabs, OpenAI, macOS, pyttsx3)
  • Automatic provider selection based on API keys
  • Configurable voices and text limits
  • Session completion announcements

πŸ”§ Professional Distribution (Coming Soon)

  • NPX for Node.js users: npx @maos/cli
  • Homebrew for macOS: brew install maos
  • Direct binaries for all platforms
  • No Rust toolchain needed for users

For MAOS Contributors

Prerequisites

  • Rust stable toolchain
  • Git 2.5+ (for worktree support)
  • Just task runner

Development Setup

# Clone the repository
git clone https://github.com/clafollett/maos.git
cd maos

# Install Rust (if needed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Build the project
cargo build --release

# Run tests
cargo test

# Install locally for testing
cargo install --path .

Architecture Overview

Multi-Agent Orchestration

  • Automatic Isolation: Each agent works in its own git worktree
  • Conflict Prevention: File locking prevents simultaneous edits
  • Session Management: Tracks multi-agent workflows seamlessly
  • Progress Tracking: Real-time visibility into agent activities

Implementation Details

  • Rust CLI: Fast, reliable, single binary distribution
  • File-Based Coordination: JSON files for state management
  • Hook Integration: Works through Claude Code's settings.json
  • Git Worktrees: Complete workspace isolation per agent

Documentation Index

Quick Links

Documentation

For Users

For Contributors

Roadmap

Phase 1: Rust CLI Development (Current)

  • Core CLI structure with clap
  • Security features (rm -rf blocking, .env protection)
  • MAOS orchestration (worktrees, sessions, locks)
  • TTS integration (multi-provider support)
  • Configuration management
  • Comprehensive test suite

Phase 2: Distribution

  • NPM package for npx distribution
  • Homebrew formula
  • GitHub releases with binaries
  • Installation scripts
  • Auto-update mechanism

Phase 3: Enhanced Features

  • Performance profiling and optimization
  • Advanced debugging commands
  • Plugin system for custom hooks
  • Web dashboard for monitoring
  • Integration with more Claude Code features

Why Choose MAOS?

Performance Matters

  • Eliminate Python startup overhead on every tool call
  • Handle hundreds of operations without slowdown
  • Near-instant execution for all commands

Professional Software

  • Compiled binary that can't be accidentally modified
  • Consistent behavior across all environments
  • Enterprise-ready security and reliability

Developer Experience

  • Simple installation via familiar tools (NPX, Homebrew)
  • Clean configuration in settings.json
  • Comprehensive documentation and support

Future-Proof

  • Written in Rust for long-term maintainability
  • Extensible architecture for new features
  • Active development and community

Project Structure

maos/
β”œβ”€β”€ Cargo.toml                    # Workspace configuration
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ maos-cli/                 # Main CLI application
β”‚   β”‚   β”œβ”€β”€ Cargo.toml
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ main.rs           # CLI entry point
β”‚   β”‚       └── commands/         # Subcommand implementations
β”‚   β”œβ”€β”€ maos-core/                # Core orchestration logic
β”‚   β”‚   β”œβ”€β”€ Cargo.toml
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ lib.rs
β”‚   β”‚       β”œβ”€β”€ session.rs        # Session management
β”‚   β”‚       └── worktree.rs       # Git worktree operations
β”‚   β”œβ”€β”€ maos-security/            # Security features
β”‚   β”‚   β”œβ”€β”€ Cargo.toml
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ lib.rs
β”‚   β”‚       └── validators.rs     # Path and command validation
β”‚   └── maos-tts/                 # TTS provider integration
β”‚       β”œβ”€β”€ Cargo.toml
β”‚       └── src/
β”‚           β”œβ”€β”€ lib.rs
β”‚           └── providers/        # ElevenLabs, OpenAI, etc.
β”œβ”€β”€ .claude/
β”‚   β”œβ”€β”€ agents/                   # Agent configurations
β”‚   └── config.example.json       # Example configuration
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ cli/                      # User documentation
β”‚   └── development/              # Contributor guides
└── scripts/
    β”œβ”€β”€ install.sh                # Installation script
    └── release.sh                # Release automation

Contributing

We welcome contributions! See CONTRIBUTING.md for details.

Key Development Principles

  1. Performance First - Every millisecond counts in hook execution
  2. Type Safety - Leverage Rust's type system for reliability
  3. User Experience - Installation and usage must be effortless
  4. Backward Compatible - Smooth migration from Python hooks
  5. Well Tested - Comprehensive test coverage required

Support

License

MIT License - see LICENSE for details.


MAOS: Professional multi-agent orchestration for Claude Code. Fast. Reliable. Invisible.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •