Skip to content

This mode serves as a code-first orchestration layer, enabling Claude to write, edit, test, and optimize code autonomously across recursive agent cycles.

License

Notifications You must be signed in to change notification settings

rumgewieselt/claude-code-flow

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌊 Claude-Flow: Agent Orchestration Platform for Claude-Code

🌟 Star on GitHub πŸ“¦ NPX Ready βœ… 95% Test Coverage πŸ¦• Deno Powered ⚑ TypeScript πŸ“– Documentation πŸ›‘οΈ MIT License

🎯 Transform Your Development Workflow

Claude-Flow is the ultimate multi-terminal orchestration platform that revolutionizes how you work with Claude Code. Imagine coordinating dozens of AI agents simultaneously, each working on different aspects of your project while sharing knowledge through an intelligent memory bank.

πŸ”₯ One command to rule them all: npx claude-flow - Deploy a full AI agent coordination system in seconds!

πŸŽ‰ What's New in v1.0.49

πŸš€ Major Release: Enterprise-Grade Swarm System

  • 🐝 Advanced Swarm Orchestration: Complete multi-agent coordination system with timeout-free execution
  • 🧠 Distributed Memory Sharing: Cross-agent knowledge sharing with persistent state management
  • ⚑ Intelligent Task Scheduling: 7+ scheduling algorithms with dependency resolution and load balancing
  • πŸ”„ Work Stealing & Load Balancing: Automatic workload distribution across agents
  • πŸ›‘οΈ Circuit Breaker Patterns: Enterprise fault tolerance with retry and recovery mechanisms
  • πŸ“Š Real-Time Monitoring: Comprehensive metrics, health checks, and performance tracking
  • πŸ”’ Security & Validation: Encryption, access control, audit logging, and input validation
  • 🎯 Comprehensive CLI: 30+ options for swarm configuration and management

πŸ†• Enhanced User Experience

  • πŸš€ Text-Based Process Management UI: New --ui flag for start command provides interactive process control
  • 🎯 Simplified SPARC Syntax: npx claude-flow sparc "build app" (no more double sparc!)
  • ⚑ Auto-Skip Permissions: --dangerously-skip-permissions by default (use --enable-permissions to restore prompts)
  • πŸ€– Non-Interactive Mode: JSON output with --non-interactive flag for automation
  • πŸ“ Directory Safety: Enhanced guidance to prevent files in node_modules
  • 🎯 17+ SPARC Modes: Including new sparc-orchestrator for complex workflows
  • πŸ“‚ Local Executable: init now creates ./claude-flow wrapper to ensure correct working directory
  • πŸ”§ Fixed SPARC Path Resolution: .roomodes now correctly found in project directory
  • πŸ“ Claude Code Slash Commands: init --sparc now creates .claude/commands/ with slash commands for all SPARC modes
  • πŸ—οΈ Modular Init Structure: Refactored init command into clean, maintainable modules for better extensibility

🐝 Swarm System Features

  • Timeout-Free Execution: Background Claude processes that never timeout
  • Agent Specialization: 9 agent types (coordinator, developer, researcher, analyzer, tester, reviewer, documenter, monitor, specialist)
  • Multiple Coordination Modes: Centralized, distributed, hierarchical, mesh, hybrid
  • Advanced Scheduling: FIFO, priority, deadline, shortest-job, critical-path, resource-aware, adaptive
  • Fault Tolerance: Retry, redundancy, checkpoint, circuit-breaker, bulkhead, timeout, graceful-degradation
  • Communication Patterns: Direct, broadcast, publish-subscribe, request-response, event-driven, gossip, hierarchical

🌟 Why Claude-Flow?

  • πŸš€ 10x Faster Development: Parallel AI agent execution with intelligent task distribution
  • 🧠 Persistent Memory: Agents learn and share knowledge across sessions
  • ⚑ SPARC Methodology: Systematic development with Specification β†’ Pseudocode β†’ Architecture β†’ Refinement β†’ Completion
  • πŸ”„ Zero Configuration: Works out-of-the-box with sensible defaults
  • πŸ€– VSCode Native: Seamless integration with your favorite IDE
  • πŸ”’ Enterprise Ready: Production-grade security, monitoring, and scaling
  • 🌐 MCP Compatible: Full Model Context Protocol support for tool integration
  • 🐝 Swarm Intelligence: Advanced multi-agent coordination with timeout-free execution

πŸ“¦ Installation

πŸš€ Get started in 30 seconds

# Initialize with SPARC development environment
Step 1. Install Claude Code: ``` npm install -g @anthropic-ai/claude ```
Step 2. ``` npx -y claude-flow@latest init --sparc ```

# Use the local wrapper after init
./claude-flow sparc "build and test my project"  # SPARC development
./claude-flow swarm "Build a REST API" --strategy development --monitor  # Swarm coordination
Optional: ./claude-flow start --ui  # Interactive process management
# ⚑ SPARC Development Workflow (NEW: Simplified!)
./claude-flow claude-flow sparc "build a todo app" # Orchestrator mode (default)
./claude-flow claude-flow sparc modes              # List 17+ development modes
./claude-flow claude-flow sparc tdd "user auth"    # Run TDD workflow

# 🐝 Advanced Swarm System (NEW!)
./claude-flow swarm "Build a REST API" --strategy development --parallel --monitor
./claude-flow swarm "Research AI trends" --strategy research --distributed --ui
./claude-flow swarm "Optimize performance" --strategy optimization --background

# 🎯 Run specific SPARC modes
npx claude-flow sparc run code "implement API"  # Code generation
npx claude-flow sparc run tdd "auth tests"      # Test-driven development
npx claude-flow sparc run architect "system"    # Architecture design

# πŸ€– Spawn a research team
./claude-flow agent spawn researcher --name "Senior Researcher"
./claude-flow agent spawn analyst --name "Data Analyst"
./claude-flow agent spawn implementer --name "Code Developer"

# πŸ“‹ Create and execute tasks
./claude-flow task create research "Research AI optimization techniques"
./claude-flow task list

# πŸ“Š Monitor in real-time
./claude-flow status
./claude-flow monitor

πŸ—οΈ Core Features

🐝 Advanced Swarm Orchestration

Enterprise-grade multi-agent coordination with timeout-free execution, distributed memory sharing, and intelligent load balancing across specialized AI agents.

🧠 Intelligent Memory Bank

Advanced CRDT-based memory system with SQLite performance and Markdown readability. Agents learn and share knowledge across sessions with cross-agent collaboration.

⚑ SPARC Development

Systematic AI-assisted development using Specification β†’ Pseudocode β†’ Architecture β†’ Refinement β†’ Completion methodology with 17+ specialized modes.

🎯 Smart Task Scheduling

7+ scheduling algorithms with dependency resolution, deadlock detection, work stealing, load balancing, and automatic retry with exponential backoff.

πŸ”’ Enterprise Security

Token-based authentication, encryption, rate limiting, circuit breakers, audit logging, access control, and role-based permissions.

🌐 MCP Integration

Full Model Context Protocol support with stdio and HTTP transports, enabling seamless integration with external tools and services.

⚑ Quick Start

🎯 Option 1: NPX (Recommended)

# Install and run in one command
npx claude-flow

# Or install globally for repeated use
npm install -g claude-flow
claude-flow --version

πŸ¦• Option 2: Deno (For Developers)

# Clone and run from source
git clone https://github.com/ruvnet/claude-code-flow.git
cd claude-code-flow
./bin/claude-flow --version

πŸ”§ Option 3: From Source (For Contributors)

git clone https://github.com/ruvnet/claude-code-flow.git
cd claude-code-flow
deno task build && deno task install

🐝 Swarm System Usage

πŸš€ Basic Swarm Commands

# Initialize with swarm support
npx claude-flow init --sparc

# Start a basic development swarm
./claude-flow swarm "Build a REST API" --strategy development

# Research-focused swarm with UI
./claude-flow swarm "Research AI trends" --strategy research --distributed --ui

# Background optimization swarm
./claude-flow swarm "Optimize performance" --strategy optimization --background --monitor

# Testing swarm with review
./claude-flow swarm "Test application" --strategy testing --review --verbose

πŸŽ›οΈ Advanced Swarm Configuration

# Full-featured swarm with all options
./claude-flow swarm "Complex project development" \
  --strategy development \
  --mode distributed \
  --max-agents 10 \
  --parallel \
  --monitor \
  --review \
  --testing \
  --encryption \
  --verbose

# Dry run to see configuration
./claude-flow swarm "Test task" --dry-run --strategy development

# Get comprehensive help
./claude-flow swarm --help

πŸ€– Swarm Agent Types

  • Coordinator: Plans and delegates tasks to other agents
  • Developer: Writes code and implements solutions
  • Researcher: Gathers and analyzes information
  • Analyzer: Identifies patterns and generates insights
  • Tester: Creates and runs tests for quality assurance
  • Reviewer: Performs code and design reviews
  • Documenter: Creates documentation and guides
  • Monitor: Tracks performance and system health
  • Specialist: Domain-specific expert agents

πŸ”„ Coordination Strategies

  • Centralized: Single coordinator manages all agents (default)
  • Distributed: Multiple coordinators share management
  • Hierarchical: Tree structure with nested coordination
  • Mesh: Peer-to-peer agent collaboration
  • Hybrid: Mixed coordination strategies

πŸ“Š Swarm Features

  • Timeout-Free Execution: Background Claude processes that never timeout
  • Work Stealing: Automatic load balancing across agents
  • Circuit Breakers: Fault tolerance with automatic recovery
  • Real-Time Monitoring: Live metrics and progress tracking
  • Distributed Memory: Cross-agent knowledge sharing
  • Quality Controls: Configurable thresholds and validation
  • Background Mode: Long-running swarms with persistent state
  • Interactive UI: Terminal-based swarm management interface

πŸ“š Documentation

Comprehensive documentation is available to help you get the most out of Claude-Flow:

πŸ’‘ Quick Start Guide

1. Initialize Claude Code Integration

# Basic init (without SPARC modes)
npx claude-flow init

# Recommended: Initialize with SPARC development modes
npx claude-flow init --sparc

The --sparc flag creates:

  • CLAUDE.md - SPARC-enhanced Claude Code configuration
  • .claude/commands/ - Claude Code slash commands for all SPARC modes
  • memory-bank.md - Memory system documentation
  • coordination.md - Agent coordination documentation
  • .roomodes - SPARC development mode configurations
  • .roo/ - SPARC templates and workflows
  • Memory folder structure with placeholders
  • ./claude-flow - Local executable wrapper (use instead of npx)

Claude Code slash commands available after init:

  • /sparc - Execute SPARC methodology workflows
  • /sparc-<mode> - Run specific SPARC modes (e.g., /sparc-architect)
  • /claude-flow-help - Show all claude-flow commands
  • /claude-flow-memory - Interact with memory system
  • /claude-flow-swarm - Coordinate multi-agent swarms

2. Start the Orchestrator

# After init, use the local wrapper:
./claude-flow start

# Or run as daemon
./claude-flow start --daemon

# With interactive UI
./claude-flow start --ui

3. Spawn Agents

# Spawn different agent types with specific capabilities
./claude-flow agent spawn researcher --name "Research Assistant" --priority 8
./claude-flow agent spawn implementer --name "Code Developer" --priority 7
./claude-flow agent spawn analyst --name "Data Analyst" --priority 6
./claude-flow agent spawn coordinator --name "Project Manager" --priority 9

# List all active agents
./claude-flow agent list

# Get detailed information about an agent
./claude-flow agent info agent-123

4. Create and Manage Tasks

# Create tasks with different priorities
./claude-flow task create research "Analyze authentication best practices" --priority 8
./claude-flow task create implementation "Build JWT authentication" --priority 9
./claude-flow task create analysis "Review security vulnerabilities" --priority 10

# Create task with dependencies
./claude-flow task create implementation "Build user management" \
  --priority 7 --deps task-123,task-456

# Assign tasks to agents
./claude-flow task assign task-123 agent-456

# List all tasks
./claude-flow task list
./claude-flow task list --verbose  # Show detailed task information

# Check specific task status
./claude-flow task status task-123

# Cancel a task
./claude-flow task cancel task-789

5. Spawn Claude Instances πŸ†•

# Spawn Claude with enhanced Claude-Flow guidance
./claude-flow claude spawn "implement user authentication" --research --parallel

# Backend-only mode with high coverage
./claude-flow claude spawn "create REST API" --mode backend-only --coverage 95

# Frontend development with feature commits
./claude-flow claude spawn "build React components" --mode frontend-only --commit feature

# Full stack with all options
./claude-flow claude spawn "build complete app" --research --parallel --coverage 90 --verbose

# Execute workflow
./claude-flow claude batch workflow.json --dry-run

Enhanced Claude Instances receive:

  • Detailed Claude-Flow system guidance
  • Proper npx claude-flow command syntax
  • Mode-specific instructions (backend/frontend/api/full)
  • Memory bank operations with examples
  • Configuration-aware development guidance

6. Monitor System Status

# Check system health
./claude-flow status

# Real-time monitoring
./claude-flow monitor

# View MCP tools
./claude-flow mcp tools

πŸš€ SPARC Development Methodology

Claude-Flow integrates the SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) methodology for systematic AI-assisted development:

Available SPARC Modes

# List all development modes
./claude-flow sparc modes

# Key modes include:
# πŸ—οΈ architect      - System design and architecture
# 🧠 code           - Clean, modular implementation  
# πŸ§ͺ tdd            - Test-driven development
# πŸ›‘οΈ security-review - Security analysis
# πŸ“š docs-writer    - Documentation creation
# πŸ”— integration    - System integration

SPARC Workflow

# Simplified orchestration (NEW!)
./claude-flow sparc "build complete authentication system"

# Run specific SPARC modes:
./claude-flow sparc run code "implement API"  # Code generation
./claude-flow sparc run tdd "auth tests"      # Test-driven development
./claude-flow sparc run architect "system"    # Architecture design

# TDD shorthand
./claude-flow sparc tdd "implement JWT authentication"

Non-Interactive Mode

The --non-interactive flag outputs JSON for integration with CI/CD pipelines and automation tools:

# Run SPARC modes with JSON output
./claude-flow sparc run code "user service" --non-interactive
./claude-flow sparc run tdd "test suite" --non-interactive

SPARC Features

  • 17+ Specialized AI Modes for different development phases
  • Memory Persistence across SPARC sessions with namespaced storage
  • TDD Enforcement with Red-Green-Refactor cycle automation
  • Modular Design with <500 line file constraints
  • Environment Safety preventing credential exposure
  • CI/CD Integration via --non-interactive flag for automation
  • Non-Interactive Mode for automation and CI/CD integration
  • Auto-Skip Permissions by default (use --enable-permissions to prompt)
  • Quality Gates with automated code analysis and security review

Architecture

Claude-Flow uses a modular architecture with the following components:

  • Orchestrator: Central coordinator managing all system components
  • Swarm System: Advanced multi-agent coordination with timeout-free execution
  • Terminal Manager: Handles terminal sessions with pooling and recycling
  • Memory Manager: Persistent storage with caching and indexing
  • Coordination Manager: Task scheduling and resource management
  • MCP Server: Tool integration via Model Context Protocol

Configuration

Default configuration file (claude-flow.config.json):

{
  "orchestrator": {
    "maxConcurrentAgents": 10,
    "taskQueueSize": 100,
    "healthCheckInterval": 30000,
    "shutdownTimeout": 30000
  },
  "swarm": {
    "maxAgents": 10,
    "defaultStrategy": "auto",
    "defaultMode": "centralized",
    "timeoutMinutes": 60,
    "qualityThreshold": 0.8,
    "enableMonitoring": true,
    "enableEncryption": false
  },
  "terminal": {
    "type": "auto",
    "poolSize": 5,
    "recycleAfter": 10,
    "healthCheckInterval": 60000,
    "commandTimeout": 300000
  },
  "memory": {
    "backend": "hybrid",
    "cacheSizeMB": 100,
    "syncInterval": 5000,
    "conflictResolution": "crdt",
    "retentionDays": 30
  },
  "coordination": {
    "maxRetries": 3,
    "retryDelay": 1000,
    "deadlockDetection": true,
    "resourceTimeout": 60000,
    "messageTimeout": 30000
  },
  "mcp": {
    "transport": "stdio",
    "port": 3000,
    "tlsEnabled": false
  },
  "logging": {
    "level": "info",
    "format": "json",
    "destination": "console"
  }
}

Agent Types

Claude-Flow supports multiple agent types:

  • Coordinator: Plans and delegates tasks to other agents
  • Researcher: Gathers and analyzes information
  • Implementer: Writes code and creates solutions
  • Analyst: Identifies patterns and generates insights
  • Developer: Full-stack development capabilities
  • Tester: Quality assurance and testing
  • Reviewer: Code and design review
  • Documenter: Documentation creation
  • Monitor: System monitoring and health checks
  • Specialist: Domain-specific expertise
  • Custom: User-defined agent types

πŸ› οΈ CLI Commands

Claude-Flow provides a comprehensive CLI for managing your AI orchestration system. For detailed command documentation, see the CLI Reference.

🌐 Global Options

  • -c, --config <path>: Path to configuration file
  • -v, --verbose: Enable verbose logging
  • --log-level <level>: Set log level (debug, info, warn, error)
  • --version: Show version information
  • --help: Show help for any command

πŸ“‹ Core Commands

init - Initialize Claude Code Integration

npx claude-flow@latest init [options]
  -s, --sparc               Initialize with SPARC development environment (recommended)
  -f, --force               Overwrite existing files
  -m, --minimal             Create minimal configuration files

Recommended first-time setup:

npx -y claude-flow@latest init --sparc

Creates:

  • CLAUDE.md - AI-readable project instructions
  • .roomodes - 17 pre-configured SPARC development modes
  • memory-bank.md - Persistent memory documentation
  • coordination.md - Agent coordination guide
  • Complete folder structure for development

start - Start Orchestration System

npx claude-flow start [options]
  -d, --daemon              Run as daemon in background
  -p, --port <port>         MCP server port (default: 3000)
  -u, --ui                  Launch interactive process management UI
  -v, --verbose             Show detailed system activity

Process Management UI Features (--ui flag):

  • Start/stop individual components (press 1-6 to toggle)
  • Real-time status monitoring
  • Process health visualization
  • Commands: A (start all), Z (stop all), R (restart all), Q (quit)

swarm - Advanced Multi-Agent Coordination πŸ†•

npx claude-flow swarm <objective> [options]
  --strategy <type>          Execution strategy (auto/research/development/analysis/testing/optimization/maintenance)
  --mode <type>              Coordination mode (centralized/distributed/hierarchical/mesh/hybrid)
  --max-agents <n>           Maximum agents (default: 5)
  --timeout <minutes>        Timeout in minutes (default: 60)
  --parallel                 Enable parallel execution
  --distributed              Enable distributed coordination
  --monitor                  Enable real-time monitoring
  --ui                       Launch terminal UI interface
  --background               Run in background mode
  --review                   Enable peer review
  --testing                  Enable automated testing
  --encryption               Enable encryption
  --verbose                  Enable detailed logging
  --dry-run                  Show configuration without executing

Swarm Examples:

# Basic development swarm
./claude-flow swarm "Build a REST API" --strategy development

# Research swarm with UI
./claude-flow swarm "Research AI trends" --strategy research --distributed --ui

# Background optimization
./claude-flow swarm "Optimize performance" --strategy optimization --background --monitor

status - Show System Status

npx claude-flow status [options]
  -v, --verbose             Show detailed status information

agent - Manage AI Agents

npx claude-flow agent <subcommand>
  spawn <type>              Spawn a new agent (researcher/implementer/analyst/coordinator)
    --name <name>           Agent name
    --priority <1-10>       Agent priority
    --max-tasks <n>         Max concurrent tasks
  list                      List all active agents
  info <agent-id>          Get detailed agent information
  terminate <agent-id>      Terminate an agent

task - Manage Tasks

npx claude-flow task <subcommand>
  create <type> <desc>      Create a new task
    --priority <1-10>       Task priority
    --deps <task-ids>       Comma-separated dependency IDs
  list                      List all tasks
    --verbose               Show task descriptions
  status <task-id>          Get task status
  cancel <task-id>          Cancel a task
  workflow <file>           Execute workflow from file
    --async                 Run workflow asynchronously

memory - Manage Memory Bank

npx claude-flow memory <subcommand>
  query <search>            Search memory entries
    --namespace <ns>        Filter by namespace
    --limit <n>             Limit results
  store <key> <value>       Store information
    --namespace <ns>        Target namespace
  export <file>             Export memory to file
  import <file>             Import memory from file
  stats                     Show memory statistics
  cleanup                   Clean up old entries
    --days <n>              Entries older than n days

mcp - MCP Server Management

npx claude-flow mcp <subcommand>
  status                    Show MCP server status
  tools                     List available MCP tools
  config                    Show MCP configuration
  logs                      View MCP server logs
    --lines <n>             Number of log lines (default: 50)

monitor - Real-time Monitoring

npx claude-flow monitor [options]
  -i, --interval <seconds>  Update interval (default: 2)
  -c, --compact             Compact view mode
  -f, --focus <component>   Focus on specific component

sparc - SPARC Development Methodology πŸ†•

npx claude-flow sparc [subcommand] [options]
  "<task>"                  Run SPARC orchestrator (default mode)
  modes [--verbose]         List available SPARC development modes
  info <mode>               Show detailed mode information
  run <mode> "<task>"       Execute specific SPARC mode
  tdd "<feature>"           Run full TDD workflow
    --namespace <ns>        Use custom memory namespace
    --dry-run               Show configuration without executing
    --verbose               Show detailed output
    --non-interactive       Run with stream-json output (for automation)
    --enable-permissions    Enable permission prompts (default: skip)

Default Behavior Updates:

  • Simplified syntax: npx claude-flow sparc "build app" (no need for run sparc)
  • Permissions auto-skipped by default (use --enable-permissions to prompt)
  • Non-interactive mode for BatchTool orchestration

claude - Spawn Claude Instances with Enhanced Guidance πŸ†•

npx claude-flow claude <subcommand>
  spawn <task>              Spawn Claude with enhanced Claude-Flow guidance
    -t, --tools <tools>     Allowed tools (comma-separated)
    --no-permissions        Use --dangerously-skip-permissions flag
    -c, --config <file>     MCP config file path
    -m, --mode <mode>       Development mode (full/backend-only/frontend-only/api-only)
    --parallel              Enable multi-agent support
    --research              Enable web research capabilities
    --coverage <n>          Test coverage target percentage (default: 80)
    --commit <freq>         Commit frequency (phase/feature/manual)
    -v, --verbose           Enable verbose output
    -d, --dry-run           Show what would be executed without running
    
  batch <workflow-file>     Execute workflow configuration
    --dry-run               Show what would be executed without running

Each spawned Claude instance receives comprehensive guidance including:

  • Claude-Flow memory operations (npx claude-flow memory store/query)
  • System management commands (npx claude-flow status/monitor)
  • Agent coordination (when --parallel is used)
  • Mode-specific development focus
  • Coverage and commit strategy awareness
  • Example commands ready to use with the Bash tool

config - Configuration Management

npx claude-flow config <subcommand>
  show                      Show current configuration
  get <path>                Get specific config value
  set <path> <value>        Set config value
  init [file]               Initialize config file
  validate <file>           Validate config file

session - Session Management

npx claude-flow session <subcommand>
  list                      List active sessions
  info <session-id>         Get session information
  terminate <session-id>    End a session

workflow - Workflow Execution

npx claude-flow workflow <file> [options]
  --validate                Validate workflow without executing
  --async                   Run workflow asynchronously
  --watch                   Watch workflow progress

help - Get Help

npx claude-flow help [command]

🎯 Common Use Cases

Complete Agent & Task Workflow:

# Initialize and start the system
npx claude-flow init --sparc
./claude-flow start --ui  # Use interactive UI for process management

# In another terminal, spawn agents
./claude-flow agent spawn researcher --name "Senior Researcher" --priority 8
./claude-flow agent spawn analyst --name "Data Analyst" --priority 7
./claude-flow agent spawn implementer --name "Lead Developer" --priority 9

# Create and manage tasks
./claude-flow task create research "Analyze authentication patterns" --priority 8
./claude-flow task create analysis "Security audit findings" --priority 7
./claude-flow task create implementation "Build secure auth system" --priority 9

# Monitor the workflow
./claude-flow monitor

Advanced Swarm Workflows:

# Initialize swarm system
npx claude-flow init --sparc

# Development swarm with parallel execution
./claude-flow swarm "Build microservices architecture" \
  --strategy development --parallel --monitor --review

# Research swarm with distributed coordination
./claude-flow swarm "Analyze blockchain technologies" \
  --strategy research --distributed --ui --verbose

# Background optimization swarm
./claude-flow swarm "Optimize application performance" \
  --strategy optimization --background --testing --encryption

# Quality assurance swarm
./claude-flow swarm "Comprehensive security audit" \
  --strategy testing --review --verbose --max-agents 8

Code Development Workflow:

npx claude-flow agent spawn implementer --name "Backend Dev" --max-tasks 3
npx claude-flow agent spawn implementer --name "Frontend Dev" --max-tasks 3
npx claude-flow agent spawn coordinator --name "Tech Lead"
npx claude-flow workflow development-pipeline.json --watch

SPARC Development Workflow:

# Initialize SPARC environment
npx claude-flow init --sparc

# Complete feature development using SPARC methodology
npx claude-flow sparc run spec-pseudocode "user authentication system"
npx claude-flow sparc run architect "JWT auth service design"
npx claude-flow sparc tdd "implement secure authentication"
npx claude-flow sparc run security-review "auth vulnerability scan"
npx claude-flow sparc run integration "connect auth to user service"

# TDD-focused development
npx claude-flow sparc tdd "payment processing system"
npx claude-flow sparc tdd "real-time notifications"

# Architecture and design
npx claude-flow sparc run architect "microservices architecture"
npx claude-flow sparc run docs-writer "API documentation"

Enhanced Claude Spawn Examples:

# Backend API development with high test coverage
./claude-flow claude spawn "build REST API with authentication" \
  --mode backend-only --coverage 95 --commit feature

# Frontend development with research capabilities
./claude-flow claude spawn "create responsive dashboard" \
  --mode frontend-only --research --verbose

# Full-stack development with parallel execution
./claude-flow claude spawn "implement user management system" \
  --parallel --coverage 90 --commit phase

# API design focus with custom tools
./claude-flow claude spawn "design GraphQL schema" \
  --mode api-only --tools "View,Edit,GrepTool,LS"

Workflow Execution:

# Execute a workflow file
./claude-flow workflow my-workflow.json

# Validate workflow before execution
./claude-flow workflow my-workflow.json --validate

# Execute with monitoring
./claude-flow workflow my-workflow.json --watch

Workflow Example

Create a workflow file (example-workflow.json):

{
  "name": "Research and Analysis Workflow",
  "tasks": [
    {
      "id": "research-1",
      "type": "research",
      "description": "Research quantum computing basics",
      "assignTo": "researcher"
    },
    {
      "id": "analyze-1",
      "type": "analysis",
      "description": "Analyze research findings",
      "dependencies": ["research-1"],
      "assignTo": "analyst"
    },
    {
      "id": "report-1",
      "type": "report",
      "description": "Generate summary report",
      "dependencies": ["analyze-1"],
      "assignTo": "coordinator"
    }
  ]
}

Execute the workflow:

./claude-flow workflow example-workflow.json

Development

Prerequisites

Setup

git clone https://github.com/ruvnet/claude-code-flow.git
cd claude-code-flow
./bin/claude-flow --version  # Verify installation

Testing

deno task test

Building

deno task build

Running from source

./bin/claude-flow --help  # Use the binary wrapper

API Usage

Claude-Flow can also be used programmatically:

import { Orchestrator, SwarmCoordinator } from 'claude-flow';

// Basic orchestrator
const orchestrator = new Orchestrator(config);
await orchestrator.initialize();

// Advanced swarm coordination
const swarm = new SwarmCoordinator({
  strategy: 'development',
  mode: 'distributed',
  maxAgents: 10,
  monitoring: { metricsEnabled: true }
});

await swarm.initialize();

// Create objective and agents
const objectiveId = await swarm.createObjective(
  'API Development',
  'Build a scalable REST API',
  'development'
);

const agentId = await swarm.registerAgent(
  'Lead Developer',
  'developer',
  { codeGeneration: true, testing: true }
);

// Execute with timeout-free background processing
await swarm.executeObjective(objectiveId);

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

License

MIT License - see LICENSE file for details.

πŸ”Œ Integration with Claude Code

Claude-Flow seamlessly integrates with Claude Code through the CLAUDE.md file created by npx claude-flow init. This enables:

  • Automatic Context Loading: Claude Code reads your project configuration
  • Build Command Integration: All build/test commands are available to Claude
  • Memory Persistence: Claude remembers context across sessions
  • Enhanced Guidance: Spawned Claude instances receive detailed Claude-Flow instructions
  • SPARC Methodology: Built-in support for systematic development with 17+ specialized AI modes
  • Swarm Integration: Claude Code SDK used for timeout-free multi-agent execution

Use with Claude Code:

# Initialize integration with SPARC and swarm support
npx -y claude-flow@latest init --sparc

# Use local wrapper after initialization
./claude-flow start --ui  # Interactive process management

# Spawn Claude with enhanced guidance
./claude-flow claude spawn "your task here" --research --parallel

# Use advanced swarm system
./claude-flow swarm "Build a REST API" --strategy development --monitor

# Claude receives:
# - Instructions on using npx claude-flow commands
# - Memory operations (store/query)
# - Agent coordination capabilities
# - Mode-specific development guidance
# - Swarm system access for complex workflows

🏒 Enterprise Features

  • πŸ” Security: Token-based auth, encryption, rate limiting, audit logging
  • πŸ“Š Monitoring: Real-time metrics, performance tracking, health checks
  • πŸ”„ Reliability: Circuit breakers, automatic retries, graceful degradation
  • πŸ“ˆ Scalability: Horizontal scaling, load balancing, resource pooling
  • πŸ›‘οΈ Compliance: Audit trails, data retention policies, access controls
  • 🐝 Swarm Intelligence: Advanced multi-agent coordination with enterprise fault tolerance

πŸ“– Resources

Documentation

Community & Support

πŸš€ Roadmap

Current Features

  • βœ… Core orchestration with multi-agent support
  • βœ… Enterprise-grade swarm system with timeout-free execution
  • βœ… CRDT-based memory bank with SQLite backend
  • βœ… MCP server integration (stdio transport)
  • βœ… Claude Code integration via init command
  • βœ… Text-based process management UI
  • βœ… 17+ SPARC development modes
  • βœ… Comprehensive CLI with 15+ commands
  • βœ… Advanced multi-agent coordination
  • βœ… Distributed memory sharing
  • βœ… Real-time monitoring and metrics

Planned Features

  • Web UI for visual orchestration
  • Plugin system for custom agent types
  • Enhanced monitoring dashboard
  • Workflow templates library
  • Advanced swarm visualization
  • Multi-language support for agents

🀝 Contributing

We welcome contributions! See our Contributing Guide for:

  • Code of Conduct
  • Development setup
  • Submission guidelines
  • Coding standards
  • Testing requirements

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

  • Built on top of Claude Code and Anthropic's Claude AI
  • Inspired by the SPARC methodology
  • Thanks to all contributors and the Claude community

πŸ“Š Stats

GitHub stars npm downloads Contributors Last commit


Built with ❀️ by rUv for the Claude community

About

This mode serves as a code-first orchestration layer, enabling Claude to write, edit, test, and optimize code autonomously across recursive agent cycles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 88.9%
  • JavaScript 9.7%
  • Shell 1.3%
  • HTML 0.1%