Skip to content
/

Claude-Flow / Ruflo

claude-flow · ruvnet/ruflo · ★ 55k · last commit 2026-05-26

Eliminates single-agent context limits and sequential bottlenecks by orchestrating fault-tolerant swarms of specialized AI agents with shared persistent memory.

Best whenAgent orchestration belongs at the infrastructure layer — a dedicated MCP server, consensus protocols, and a vector database — not in a CLAUDE.md instruction…
Skip ifStopping after calling claude-flow MCP tools instead of immediately continuing work, Using MCP tools alone for execution without the Task tool
Primitive shape 322 total
Commands 160 Skills 107 Subagents 44 Hooks 10 MCP tools 1
00

Summary

Claude-Flow / Ruflo — Summary

Claude-Flow (published to npm as claude-flow, GitHub repo renamed to ruvnet/ruflo) is an enterprise-grade multi-agent swarm orchestration platform for Claude Code and OpenAI Codex that lets developers deploy coordinated swarms of up to 60+ specialized AI agents against a shared memory store and MCP toolchain. It solves the problem of single-agent context limits and sequential task bottlenecks by providing a hierarchical coordinator-worker model, five swarm topologies (hierarchical, mesh, hierarchical-mesh, adaptive, flat), Byzantine fault-tolerant consensus strategies, and a persistent vector memory backend called AgentDB. What makes it distinct is the combination of SPARC methodology (a five-stage Specification → Pseudocode → Architecture → Refinement → Completion workflow), a built-in MCP server exposing 285–305 tools to the Claude Code session, and a hive-mind abstraction with queen/worker roles and Raft/CRDT/gossip consensus — none of which any comparable Claude Code framework ships together. It targets senior developers building complex multi-service systems who want fully automated agentic pipelines; however it carries a documented supply-chain security incident (Remote AI Behavior Injection via IPFS on the npm package) that raises production trust questions, making it best classified as a powerful but risk-stratified tool rather than a straightforward enterprise-ready platform.

01

Overview

Claude-Flow / Ruflo — Overview

Origin Story

Claude-Flow was created by ruvnet (Ruv, maintainer email ruv@ruv.io) and originally hosted at ruvnet/claude-flow. The repo was later renamed to ruvnet/ruflo while keeping the npm package name claude-flow and the binary name claude-flow. The homepage redirects to https://Cognitum.One/Consulting. The project began as a multi-agent orchestration framework for Claude Code and expanded over ~6,000+ commits (per CLAUDE.md: "6,000+ commits, 314 MCP tools, 16 agent roles + custom types") to include a full MCP server, a plugin ecosystem, a proprietary vector database (AgentDB / RuVector), and Codex CLI integration.

As of v3.10.1 (npm claude-flow@3.10.1), the project is a TypeScript monorepo with packages @claude-flow/cli, @claude-flow/mcp, @claude-flow/neural, @claude-flow/shared, @claude-flow/codex, and 21 native plugins.

Tagline / README Introduction

🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integration, and native Claude Code / Codex Integration

Philosophy

The framework is built on a clear separation of concerns stated explicitly in AGENTS.md:

╔══════════════════════════════════════════════════════════════════╗
║  1. claude-flow = LEDGER (tracks state, stores memory, coordinates)
║  2. Codex = EXECUTOR (writes code, runs commands, creates files)
║  3. NEVER stop after calling claude-flow - IMMEDIATELY continue working
║  4. If you need something BUILT/EXECUTED, YOU do it, not claude-flow
║  5. ALWAYS search memory BEFORE starting: memory search --query "task"
║  6. ALWAYS store patterns AFTER success: memory store --namespace patterns
╚══════════════════════════════════════════════════════════════════╝

The CLAUDE.md configuration document reinforces a concurrency-first golden rule:

"1 MESSAGE = ALL RELATED OPERATIONS — All operations MUST be concurrent/parallel in a single message"

The architecture mandates:

  • ALWAYS batch ALL todos in ONE TodoWrite call (5-10+ minimum)
  • ALWAYS spawn ALL agents in ONE message with full instructions via Task tool
  • ALWAYS batch ALL file reads/writes/edits in ONE message

Problem Framing

The framework addresses three core limitations of single-agent Claude Code sessions: context window exhaustion on large codebases, sequential (slow) execution, and lack of persistent memory across sessions. The solution is a three-tier routing model (WASM Agent Booster at <1ms for trivial transforms, Haiku at ~500ms for moderate tasks, Sonnet/Opus at 2-5s for complex reasoning) backed by a shared AgentDB SQLite/vector store that persists knowledge across sessions.

What We Believe

From CLAUDE.md:

"Follow Domain-Driven Design with bounded contexts. Keep files under 500 lines. Use typed interfaces for all public APIs. Prefer TDD London School (mock-first) for new code. Use event sourcing for state changes."

02

Architecture

Claude-Flow / Ruflo — Architecture

Distribution Type

npm-package (also ships as a Claude Code plugin via .claude-plugin/)

Install Methods

# Primary: npx (no install required)
npx claude-flow@alpha init

# Specific version
npx claude-flow@3.10.1 init

# As plugin in Claude Code
/plugin marketplace add ruvnet/ruflo
/plugin install ruflo-core@ruflo

# As MCP server entry in .claude/settings.json
# (auto-configured on init)
{
  "mcpServers": {
    "claude-flow": {
      "command": "npx",
      "args": ["-y", "ruflo@latest", "mcp", "start"]
    }
  }
}

File / Directory Layout (Top-Level)

ruvnet/ruflo/
├── .agents/                    # Codex CLI skill definitions (107 SKILL.md files)
│   ├── config.toml             # Codex CLI configuration
│   ├── skills/                 # 107 agent skill directories
│   └── README.md
├── .claude/                    # Claude Code configuration
│   ├── settings.json           # Hooks, MCP servers, permissions, env vars
│   ├── agents/                 # Agent persona markdown files
│   ├── commands/               # Slash-command definitions (~160 .md files)
│   │   ├── sparc/              # SPARC methodology commands
│   │   ├── hive-mind/          # Hive-mind commands
│   │   ├── swarm/              # Swarm orchestration commands
│   │   ├── hooks/              # Hook commands
│   │   ├── memory/             # Memory commands
│   │   ├── github/             # GitHub integration commands
│   │   └── ...
│   └── helpers/                # hook-handler.cjs, auto-memory-hook.mjs, statusline.cjs
├── .claude-plugin/             # Claude Code plugin manifest
│   └── hooks/
│       └── hooks.json          # PreToolUse, PostToolUse, Stop hooks
├── plugins/                    # 32 native Ruflo plugins
│   ├── ruflo-agentdb/          # AgentDB memory substrate
│   ├── ruflo-sparc/            # SPARC methodology plugin
│   ├── ruflo-swarm/            # Swarm orchestration plugin
│   ├── ruflo-rag-memory/       # RAG + memory plugin
│   ├── ruflo-browser/          # Browser automation plugin
│   └── ...
├── v3/                         # TypeScript monorepo (v3 packages)
│   ├── @claude-flow/cli/       # CLI entry (49 commands)
│   ├── @claude-flow/mcp/       # MCP server (285-305 tools)
│   ├── @claude-flow/memory/    # AgentDB + HNSW search
│   ├── @claude-flow/neural/    # Neural coordination
│   ├── @claude-flow/hooks/     # 17 hooks + 12 workers
│   ├── @claude-flow/codex/     # Dual-mode Claude + Codex
│   ├── @claude-flow/guidance/  # Governance control plane
│   └── plugins/                # Plugin implementations (agentic-qe, gastown-bridge, etc.)
├── CLAUDE.md                   # Main configuration document
├── AGENTS.md                   # Codex-specific agent guidance
├── package.json                # npm package (name: claude-flow)
├── agentdb.rvf                 # AgentDB vector format file
└── verification/               # Baseline JSONs for MCP tool counts

Required Dependencies

  • Node.js: 18+ (ESM modules)
  • npm/npx: For package installation
  • Claude Code CLI: Primary target (Claude Code with MCP support)
  • OpenAI Codex CLI: Secondary target (via .agents/config.toml)

Optional runtime dependencies include:

  • agentdb@^3.0.0-alpha.14 — vector + hierarchical memory store
  • @ruvector/core, @ruvector/router — vector routing (RaBitQ WASM quantization)
  • @ruvector/rabitq-wasm — 1-bit quantization (32× memory reduction)

Configuration Files

File Purpose
.claude/settings.json Hooks, MCP servers, permissions allowlist, model preferences, env vars
CLAUDE.md Primary behavioral rules, architecture patterns, concurrency golden rule
AGENTS.md Codex CLI-specific agent guide (LEDGER vs EXECUTOR pattern)
.agents/config.toml Codex CLI configuration (model, approval policy, sandbox mode)
agentdb.rvf AgentDB vector format binary file
.claude-plugin/hooks/hooks.json Claude Code plugin hook definitions
v3/swarm.config.ts Swarm topology configuration
03

Components

Claude-Flow / Ruflo — Components

Commands (Slash-Commands in .claude/commands/)

Count: ~160 command .md files across categories. Key commands by category:

SPARC Commands

Command Purpose
/sparc SPARC orchestrator — delegates to specialist modes
/sparc-architect System design and architecture
/sparc-code / /sparc-coder Auto-coder implementation
/sparc-tdd / /sparc-tester TDD workflow (Red-Green-Refactor)
/sparc-debug / /sparc-debugger Debugging specialist
/sparc-security-review Security review
/sparc-docs-writer / /sparc-documenter Documentation generation
/sparc-integration System integration
/sparc-post-deployment-monitoring-mode Deployment monitoring
/sparc-refinement-optimization-mode Code optimization
/sparc-ask Interactive question/answer mode
/sparc-devops DevOps automation
/sparc-tutorial SPARC tutorial
/sparc-supabase-admin Supabase administration
/sparc-spec-pseudocode Specification writer
/sparc-mcp MCP integration mode
/sparc-sparc SPARC orchestrator (recursive)
/sparc-orchestrator Orchestration mode
/sparc-researcher Research mode
/sparc-reviewer Code review mode
/sparc-batch-executor Batch execution
/sparc-memory-manager Memory management
/sparc-swarm-coordinator Swarm coordination
/sparc-workflow-manager Workflow management

Hive-Mind Commands

Command Purpose
/hive-mind Main hive-mind collective intelligence
/hive-mind-init Initialize hive-mind system
/hive-mind-spawn Spawn hive-mind swarm
/hive-mind-status Check status
/hive-mind-resume Resume paused session
/hive-mind-stop Stop running session
/hive-mind-consensus View/manage consensus
/hive-mind-memory Hive-mind memory operations
/hive-mind-metrics View metrics
/hive-mind-sessions Manage sessions
/hive-mind-wizard Interactive wizard

Swarm Commands

Command Purpose
/swarm Main swarm orchestration
/swarm-init Initialize swarm
/swarm-spawn Spawn agents
/swarm-status Monitor status
/swarm-monitor Real-time monitoring
/swarm-modes View available modes
/swarm-strategies View strategies
/swarm-background Background execution
/swarm-analysis Analysis swarm

Coordination Commands

Command Purpose
/coordination-init Initialize coordination
/coordination-orchestrate Orchestrate tasks
/coordination-spawn Spawn agents
/coordination-task-orchestrate Task-level orchestration

Hook Commands

Command Purpose
/hooks-setup Set up hooks
/hooks-overview View hooks overview
/hooks-pre-task Pre-task hook
/hooks-post-task Post-task hook
/hooks-pre-edit Pre-edit hook
/hooks-post-edit Post-edit hook
/hooks-session-end Session end hook

Memory Commands

Command Purpose
/claude-flow-memory Memory operations
/memory-persist Persist memory
/memory-search Search memory
/memory-usage View memory usage
/memory-neural Neural memory training

Other Key Commands

Command Purpose
/claude-flow-help Help documentation
/claude-flow-swarm Swarm quick-start
Various /github/* GitHub PR management, code review, issue tracking, releases
Various /monitoring/* Real-time agent monitoring, metrics
Various /optimization/* Topology optimization, parallel execution
Various /automation/* Auto-agent, self-healing, workflow selection

Skills (in .agents/skills/)

Count: 107 unique skill directories (107 SKILL.md files). Key named skills:

SPARC Methodology Skills: agent-specification, agent-pseudocode, agent-architecture, agent-refinement, agent-implementer-sparc-coder, agent-sparc-coordinator, sparc-methodology

Coordination Skills: agent-adaptive-coordinator, agent-byzantine-coordinator, agent-consensus-coordinator, agent-collective-intelligence-coordinator, agent-gossip-coordinator, agent-hierarchical-coordinator, agent-mesh-coordinator, agent-queen-coordinator, agent-v3-queen-coordinator, agent-coordinator-swarm-init, agent-coordination

Swarm Skills: agent-swarm, swarm-orchestration, swarm-advanced, agent-swarm-memory-manager, agent-multi-repo-swarm, agent-code-review-swarm, agent-release-swarm, agent-tdd-london-swarm

Memory Skills: agentdb-advanced, agentdb-learning, agentdb-memory-patterns, agentdb-optimization, agentdb-vector-search, agent-memory-coordinator, agent-v3-memory-specialist, memory-management, reasoningbank-agentdb, reasoningbank-intelligence

Developer Skills: agent-coder, agent-architect, agent-architecture, agent-planner, agent-goal-planner, agent-code-goal-planner, agent-code-analyzer, agent-analyze-code-quality, agent-tester, agent-reviewer, agent-researcher, agent-orchestrator-task, agent-worker-specialist

Operations Skills: agent-ops-cicd-github, agent-github-pr-manager, agent-github-modes, agent-release-manager, agent-issue-tracker, agent-project-board-sync, agent-sync-coordinator, agent-pr-manager, agent-swarm-pr, github-automation, github-code-review, github-release-management

Performance Skills: agent-performance-analyzer, agent-performance-benchmarker, agent-performance-monitor, agent-performance-optimizer, agent-matrix-optimizer, agent-pagerank-analyzer, performance-analysis, worker-benchmarks

Consensus Algorithm Skills: agent-raft-manager, agent-quorum-manager, agent-crdt-synchronizer, agent-load-balancer, agent-resource-allocator, agent-topology-optimizer

Specialized Skills: agent-neural-network, agent-safla-neural, agent-sona-learning-optimizer, flow-nexus-neural, neural-training, agent-trading-predictor, agent-agentic-payments, agent-payments, agent-authentication, agent-security-manager, agent-v3-security-architect, hive-mind, hive-mind-advanced

Subagents (Named Roles)

Count: 44 named agents in inventory (per verification/inventory.json). From .claude/agents/:

Key agent personas include: architect, coder, tester, reviewer, security-architect, database-specialist, swarm-memory-manager, memory-coordinator, coordinator, queen-coordinator, worker-specialist, performance-engineer, integration-architect, v3-queen-coordinator

From v3/plugins/gastown-bridge/agents/: architect.yaml, coder.yaml, reviewer.yaml, security-architect.yaml, tester.yaml

Hooks (Claude Code Hook Events)

Count: 7 distinct event types configured in .claude/settings.json

Event What It Does
PreToolUse (Bash matcher) Runs hook-handler.cjs pre-bash — intercepts bash commands for routing and safety checks
PreToolUse (Write/Edit/MultiEdit matcher) Runs ruflo-hook.sh modify-file — pre-edit validation
PostToolUse (Write/Edit/MultiEdit matcher) Runs hook-handler.cjs post-edit — format, update memory
UserPromptSubmit Runs hook-handler.cjs route — 3-tier model routing decision (WASM/Haiku/Sonnet)
SessionStart Runs hook-handler.cjs session-restore + auto-memory-hook.mjs import — restores session state and imports memory
SessionEnd Runs hook-handler.cjs session-end — persists state
Stop Runs auto-memory-hook.mjs sync — syncs memory to AgentDB
SubagentStop Runs hook-handler.cjs post-task — handles subagent completion
PreCompact (manual) Prints SPARC/agent guidance before compaction, saves session state
PreCompact (auto) Prints SPARC/agent guidance before auto-compaction

MCP Servers

Count: 1 bundled MCP server (claude-flow) exposing 285–305 tools (305 per verification/inventory.json as of latest; 285 per baseline from 2026-05-11)

Server Invocation Tool Categories
claude-flow npx -y ruflo@latest mcp start mcp__claude-flow__*, mcp__ruv-swarm__*, mcp__flow-nexus__*

MCP tool namespaces include: agentdb_* (15 tools), embeddings_* (10 tools), ruvllm_hnsw_* (3 tools), swarm management, memory operations, SPARC mode runners, agent spawning, performance analysis.

Scripts / Binaries

Binary/Script Purpose
claude-flow (bin) Main CLI entry point (./bin/cli.js)
npx claude-flow init Initialize project
npx claude-flow swarm Swarm orchestration
npx claude-flow hive-mind Hive-mind collective intelligence
npx claude-flow sparc SPARC methodology runner
npx claude-flow memory Memory operations
npx claude-flow hook Hook management
npx claude-flow mcp start Start MCP server
npx claude-flow agent Agent management
npx claude-flow neural Neural training
npx claude-flow daemon Background daemon
.claude/helpers/hook-handler.cjs Hook event processor
.claude/helpers/auto-memory-hook.mjs Memory sync hook
.claude/helpers/statusline.cjs Status line renderer
scripts/ruflo-hook.sh (POSIX) Cross-platform hook shim
05

Prompts

Claude-Flow / Ruflo — Prompts

1. SPARC Orchestrator System Prompt (/.claude/commands/sparc.md)

This is the top-level system prompt that fires when /sparc is invoked. It establishes the orchestrator persona and delegates to specialist modes:

---
name: sparc
description: Execute SPARC methodology workflows with Claude-Flow
---

# ⚡️ SPARC Development Methodology

You are SPARC, the orchestrator of complex workflows. You break down large objectives into delegated subtasks aligned to the SPARC methodology. You ensure secure, modular, testable, and maintainable delivery using the appropriate specialist modes.

## SPARC Workflow

Follow SPARC:

1. Specification: Clarify objectives and scope. Never allow hard-coded env vars.
2. Pseudocode: Request high-level logic with TDD anchors.
3. Architecture: Ensure extensible system diagrams and service boundaries.
4. Refinement: Use TDD, debugging, security, and optimization flows.
5. Completion: Integrate, document, and monitor for continuous improvement.

Use `new_task` to assign:
- spec-pseudocode

## Available SPARC Modes

- `/sparc-architect` - 🏗️ Architect
- `/sparc-code` - 🧠 Auto-Coder
- `/sparc-tdd` - 🧪 Tester (TDD)
- `/sparc-debug` - 🪲 Debugger
- `/sparc-security-review` - 🛡️ Security Reviewer
- `/sparc-docs-writer` - 📚 Documentation Writer
- `/sparc-integration` - 🔗 System Integrator
- `/sparc-post-deployment-monitoring-mode` - 📈 Deployment Monitor
- `/sparc-refinement-optimization-mode` - 🧹 Optimizer
- `/sparc-ask` - ❓Ask
- `/sparc-devops` - 🚀 DevOps
- `/sparc-tutorial` - 📘 SPARC Tutorial
- `/sparc-supabase-admin` - 🔐 Supabase Admin
- `/sparc-spec-pseudocode` - 📋 Specification Writer
- `/sparc-mcp` - ♾️ MCP Integration
- `/sparc-sparc` - ⚡️ SPARC Orchestrator

## SPARC Methodology Phases

1. **📋 Specification**: Define requirements, constraints, and acceptance criteria
2. **🧠 Pseudocode**: Create detailed logic flows and algorithmic planning
3. **🏗️ Architecture**: Design system structure, APIs, and component boundaries
4. **🔄 Refinement**: Implement with TDD (Red-Green-Refactor cycle)
5. **✅ Completion**: Integrate, document, and validate against requirements

Prompting technique: The orchestrator uses explicit phase labeling with emoji markers, mandatory TDD anchoring in pseudocode, and delegation via new_task to sub-modes. The "never hard-coded env vars" rule is enforced at the specification stage before any code is written.


2. SPARC Specification Writer Mode (/.claude/commands/sparc/spec-pseudocode.md)

---
name: sparc-spec-pseudocode
description: 📋 Specification Writer - You capture full project context—functional requirements, edge cases, constraints—and translate t...
---

# 📋 Specification Writer

## Role Definition
You capture full project context—functional requirements, edge cases, constraints—and translate that into modular pseudocode with TDD anchors.

## Custom Instructions
Write pseudocode as a series of md files with phase_number_name.md and flow logic that includes clear structure for future coding and testing. Split complex logic across modules. Never include hard-coded secrets or config values. Ensure each spec module remains < 500 lines.

## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation

## Usage

### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
  mode: "spec-pseudocode",
  task_description: "define payment flow requirements",
  options: {
    namespace: "spec-pseudocode",
    non_interactive: false
  }
}

Option 2: Using NPX CLI (Fallback when MCP not available)

npx claude-flow sparc run spec-pseudocode "define payment flow requirements"
npx claude-flow@alpha sparc run spec-pseudocode "define payment flow requirements"

**Prompting technique**: This mode uses a strict file-naming convention (`phase_number_name.md`), module size caps (<500 lines), and a three-option invocation hierarchy (MCP preferred → NPX fallback → local install) to ensure the agent picks the most context-aware path.

---

## 3. SPARC CODER Agent Skill Definition (`/.agents/skills/agent-implementer-sparc-coder/SKILL.md`)

This is an agent skill used by the Codex CLI — it demonstrates the pre/post hook embedding pattern:

```yaml
---
name: sparc-coder
type: development
color: blue
description: Transform specifications into working code with TDD practices
capabilities:
  - code-generation
  - test-implementation
  - refactoring
  - optimization
  - documentation
  - parallel-execution
priority: high
hooks:
  pre: |
    echo "💻 SPARC Implementation Specialist initiating code generation"
    echo "🧪 Preparing TDD workflow: Red → Green → Refactor"
    # Check for test files and create if needed
    if [ ! -d "tests" ] && [ ! -d "test" ] && [ ! -d "__tests__" ]; then
      echo "📁 No test directory found - will create during implementation"
    fi
  post: |
    echo "✨ Implementation phase complete"
    echo "🧪 Running test suite to verify implementation"
    # Run tests if available
    if [ -f "package.json" ]; then
      npm test --if-present
    elif [ -f "pytest.ini" ] || [ -f "setup.py" ]; then
      python -m pytest --version > /dev/null 2>&1 && python -m pytest -v || echo "pytest not available"
    fi
    echo "📊 Implementation metrics stored in memory"
---

# SPARC Implementation Specialist Agent

## Core Implementation Principles

### 1. Test-Driven Development (TDD)
- Write failing tests first (Red)
- Implement minimal code to pass (Green)
- Refactor for quality (Refactor)
- Maintain high test coverage (>80%)

### 2. Parallel Implementation
- Create multiple test files simultaneously
- Implement related features in parallel
- Batch file operations for efficiency
- Coordinate multi-component changes

## Implementation Workflow

### Phase 1: Test Creation (Red)
```javascript
[Parallel Test Creation]:
  - Write("tests/unit/auth.test.js", authTestSuite)
  - Write("tests/unit/user.test.js", userTestSuite)
  - Write("tests/integration/api.test.js", apiTestSuite)
  - Bash("npm test")  // Verify all fail

Phase 2: Implementation (Green)

[Parallel Implementation]:
  - Write("src/auth/service.js", authImplementation)
  - Write("src/user/model.js", userModel)

**Prompting technique**: Pre/post shell hooks embedded in the YAML frontmatter auto-enforce TDD. The `post:` hook automatically runs the test suite after code generation, making test verification mandatory rather than optional.

---

## 4. SPARC Specification Agent Skill (`/.agents/skills/agent-specification/SKILL.md`)

This shows how SPARC phase agents store memory as part of their lifecycle:

```yaml
---
name: specification
type: analyst
color: blue
description: SPARC Specification phase specialist for requirements analysis
capabilities:
  - requirements_gathering
  - constraint_analysis
  - acceptance_criteria
  - scope_definition
  - stakeholder_analysis
priority: high
sparc_phase: specification
hooks:
  pre: |
    echo "📋 SPARC Specification phase initiated"
    memory_store "sparc_phase" "specification"
    memory_store "spec_start_$(date +%s)" "Task: $TASK"
  post: |
    echo "✅ Specification phase complete"
    memory_store "spec_complete_$(date +%s)" "Specification documented"
---

# SPARC Specification Agent

## SPARC Specification Phase

The Specification phase is the foundation of SPARC methodology, where we:
1. Define clear, measurable requirements
2. Identify constraints and boundaries
3. Create acceptance criteria
4. Document edge cases and scenarios
5. Establish success metrics

## Specification Process

### 1. Requirements Gathering

```yaml
specification:
  functional_requirements:
    - id: "FR-001"
      description: "System shall authenticate users via OAuth2"
      priority: "high"
      acceptance_criteria:
        - "Users can login with Google/GitHub"
        - "Session persists for 24 hours"
        - "Refresh tokens auto-renew"
      
  non_functional_requirements:
    - id: "NFR-001"
      category: "performance"
      description: "API response time <200ms for 95% of requests"
      measurement: "p95 latency metric"

**Prompting technique**: The `sparc_phase: specification` YAML key acts as a machine-readable phase tag. The `pre:` hook calls `memory_store` with a timestamp key, creating a searchable audit trail of when each phase started and completed across sessions.

---

## 5. Hook Handler — Concurrency Golden Rule (CLAUDE.md)

From the main `CLAUDE.md` (the governing system prompt for the entire project):

```markdown
## Swarm Configuration & Anti-Drift

### Anti-Drift Coding Swarm (PREFERRED DEFAULT)

- ALWAYS use hierarchical topology for coding swarms
- Keep maxAgents at 6-8 for tight coordination
- Use specialized strategy for clear role boundaries
- Use `raft` consensus for hive-mind (leader maintains authoritative state)
- Run frequent checkpoints via `post-task` hooks
- Keep shared memory namespace for all agents

```javascript
mcp__ruv-swarm__swarm_init({
  topology: "hierarchical",
  maxAgents: 8,
  strategy: "specialized"
})

3-Tier Model Routing (ADR-026)

Tier Handler Latency Cost Use Cases
1 Agent Booster (WASM) <1ms $0 Simple transforms (var→const, add types) — Skip LLM entirely
2 Haiku ~500ms $0.0002 Simple tasks, low complexity (<30%)
3 Sonnet/Opus 2-5s $0.003-0.015 Complex reasoning, architecture, security (>30%)

**Prompting technique**: The 3-tier model routing is embedded as a decision table in CLAUDE.md, not in code. The `UserPromptSubmit` hook reads this table at runtime and routes each prompt to the cheapest capable model tier, making cost optimization a system-level behavior rather than a per-agent decision.

---

## 6. Pre-Compact Hook Guidance (`.claude-plugin/hooks/hooks.json`)

The PreCompact hook injects guidance into every context compaction event:

```json
{
  "PreCompact": {
    "matcher": "manual",
    "command": "/bin/bash -c 'INPUT=$(cat); echo \"🔄 PreCompact Guidance:\"; echo \"📋 IMPORTANT: Review CLAUDE.md in project root for:\"; echo \"   • 54 available agents and concurrent usage patterns\"; echo \"   • Swarm coordination strategies (hierarchical, mesh, adaptive)\"; echo \"   • SPARC methodology workflows with batchtools optimization\"; echo \"   • Critical concurrent execution rules (GOLDEN RULE: 1 MESSAGE = ALL OPERATIONS)\"'"
  }
}

Prompting technique: The PreCompact hook re-injects the golden rule and agent count at every /compact event, ensuring a Claude instance that lost context due to compaction immediately re-learns the swarm configuration parameters. This is a systematic solution to context-window amnesia.

09

Uniqueness

Claude-Flow / Ruflo — Uniqueness & Positioning

What Does This Do That No Other Seed Framework Does?

Claude-Flow combines five capabilities that no single comparable framework ships together:

  1. A bundled MCP server with 285–305 tools exposing swarm management, agent lifecycle, memory operations, and SPARC mode-running as MCP tool calls — other frameworks configure Claude Code but do not ship an MCP server.

  2. Byzantine fault-tolerant consensus strategies (raft, gossip, crdt, quorum, byzantine) for distributed agent coordination — no other framework in this set implements distributed systems consensus algorithms.

  3. AgentDB: a proprietary hybrid vector + SQLite memory store with 29 named controllers, HNSW search, RaBitQ 1-bit quantization (32× memory reduction), causal graphs, and a hash-chained attestation log — purpose-built for multi-agent memory persistence.

  4. 3-tier model routing dispatched at the UserPromptSubmit hook level: WASM Agent Booster (<1ms, $0) for trivial transforms, Haiku for moderate tasks, Sonnet/Opus for complex reasoning — cost optimization baked into the hook architecture, not left to the user.

  5. Dual-mode Claude Code + Codex CLI orchestration with an explicit LEDGER/EXECUTOR division — claude-flow tracks state and memory while Codex or Claude Code does actual file operations, enabling cross-platform agent swarms that span both AI platforms.

What Does It Explicitly DROP That Others Have?

  • No standalone IDE integration — no Cursor, Windsurf, or VS Code extension. Requires Claude Code or Codex CLI.
  • No YAML/Gherkin spec format — specs are always Markdown. No structured test case syntax like Gherkin.
  • No human-in-the-loop approval gates by defaultauto-spawn-agents defaults to true, approval policy to on-request (not always). Heavy automation orientation.
  • No monolithic CLAUDE.md methodology doc — the behavioral rules are distributed across CLAUDE.md, AGENTS.md, .claude/settings.json, and 107 SKILL.md files; there is no single document to read.

One-Sentence Positioning

Claude-Flow is the only Claude Code framework that ships a production multi-agent swarm runtime — including an MCP server, Byzantine fault-tolerant consensus, a vector memory database, and a five-phase SPARC workflow — as a single npx command.

Failure Modes / Criticisms

1. Supply-Chain Security Incident (CRITICAL)

From r/LocalLLaMA (1r8oehn):

"claude-flow npm package - Remote AI Behavior Injection via IPFS" / "Supply Chain Vulnerability in claude-flow npm"

A Reddit post documented a supply-chain vulnerability in the claude-flow npm package involving Remote AI Behavior Injection via IPFS. The mechanism: the npm package fetched or referenced content from IPFS (InterPlanetary File System) hashes, which allowed externally-hosted content to influence AI model behavior at runtime — a form of prompt injection via supply chain. This is a serious trust concern for any production deployment, as npm installs could pull in remotely-mutable AI behavior instructions.

The CLAUDE.md itself includes a security configuration (cveCheck: true, threatModel: true, autoScan: true) suggesting the maintainer is aware of security concerns, but the npm install path remains the primary distribution method.

2. "Not Fully Implemented" Criticism

From r/LocalLLaMA (1qnjota):

"claude-flow 'The leading agent orchestration platform for Claude' with 5.2k commits, but yeah, it's not fully implemented"

The framework's marketing ("leading agent orchestration platform," "enterprise-grade") outpaces reality. The graphAdapter controller is explicitly disabled in AgentDB pending an external graph-DB connection (ADR-095). Several alpha-tagged packages (agentdb@^3.0.0-alpha.14, @claude-flow/mcp@^3.0.0-alpha.8) indicate unstable APIs. The verification/mcp-tool-baseline.json note states "ADR-112 baseline — monotone decreasing for all three counts" suggesting tool counts are actively being reduced.

3. Complexity Overhead

107 SKILL.md files with acknowledged duplication (CLAUDE.md note: "repo has 367 SKILL.md files (5x duplicates of common skills) across .agents/skills, .claude/skills, archive/v2/.claude/skills, v3/@claude-flow/{cli,mcp}/.claude/skills") creates maintenance burden and Claude Code skill listing budget issues (addressed by bumping skillListingBudgetFraction to 0.06).

4. Star Count Inflation Concern

55,218 stars on a repo created 2025-06-02 (less than 12 months ago) with only 24 contributors is anomalous. Combined with the supply-chain incident, this raises questions about organic adoption vs. marketing-driven growth.

Competitors Named in README

(none explicitly named)

Inspired By

(not stated in source)

04

Workflow

Claude-Flow / Ruflo — Workflow

Workflow Phases

SPARC Methodology (Primary Workflow)

The core workflow follows the SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) methodology:

Phase Stage Artifact(s) Produced
1 Specification phase_1_spec.md — functional requirements, NFRs, constraints, acceptance criteria, edge cases
2 Pseudocode phase_2_pseudocode.md — algorithmic logic, TDD anchors, module boundaries
3 Architecture phase_3_architecture.md — system diagrams, service boundaries, API contracts, extensibility design
4 Refinement Code files + test files — TDD Red-Green-Refactor cycles, security review, optimization passes
5 Completion Integrated codebase + phase_5_completion.md — documentation, deployment config, monitoring setup

Each phase is handled by a dedicated SPARC mode (specialist agent): spec-pseudocode, architect, code/coder, tdd, debug, security-review, integration, post-deployment-monitoring-mode, refinement-optimization-mode.

Swarm Workflow (Parallel Execution)

For complex tasks, the swarm workflow runs concurrently:

Step Action Artifact
1 swarm_init (MCP) + spawn agents via Task tool (same message) Swarm coordination record in AgentDB
2 Agents execute parallel subtasks Partial implementations, test results
3 Coordinator aggregates via memory store Merged state in AgentDB namespace
4 Verification gate Test suite pass/fail
5 Session-end hook persists Memory exported to AgentDB

Hive-Mind Workflow

  1. hive-mind init — initialize collective intelligence system
  2. hive-mind spawn — spawn queen + workers with chosen consensus (raft/byzantine/gossip/crdt/quorum)
  3. Queen maintains authoritative state, workers execute tasks
  4. Results aggregate via consensus protocol
  5. hive-mind stop / session-end hook persists state

Human Approval Gates

Per .agents/config.toml:

approval_policy = "on-request"  # Require approval for significant changes

Specific gates:

  • Before spawning agents: The auto-spawn-agents flag defaults to true; can be set to false for manual control via --auto-spawn-agents false
  • Bash command execution: PreToolUse hook runs routing check; potentially blocks or reroutes based on complexity
  • Significant code changes: approval_policy = "on-request" in Codex config
  • Never-approval mode available: approval_policy = "never" exists but flagged "use with caution"

TDD Enforcement

Yes — enforced by default in SPARC Refinement phase and the tdd-london-swarm strategy.

From agent-implementer-sparc-coder/SKILL.md:

### 1. Test-Driven Development (TDD)
- Write failing tests first (Red)
- Implement minimal code to pass (Green)
- Refactor for quality (Refactor)
- Maintain high test coverage (>80%)

From CLAUDE.md:

"Prefer TDD London School (mock-first) for new code"

The sparc-tdd command and agent-tdd-london-swarm skill enforce TDD workflows. Post-hook in the SPARC coder skill automatically runs test suite on completion.

Multi-Agent Execution

Yes — core design principle.

From CLAUDE.md (the Golden Rule):

"1 MESSAGE = ALL RELATED OPERATIONS — MUST spawn concurrent agents using Claude Code's Task tool. Never use MCP tools alone for execution"

  • Agents are spawned via Claude Code's Task tool simultaneously in a single message
  • MCP swarm_init called in the same message to register coordination
  • Maximum agents: 15 (per swarm config), 6-8 recommended for tight coordination
  • Three topologies for different work patterns: hierarchical (coding/default), mesh (research), hierarchical-mesh (complex hybrid)

Git Worktrees / Isolated Workspaces

Yes — supported via agent-multi-repo-swarm skill and Jujutsu VCS plugin (ruflo-jujutsu)

The framework has explicit multi-repo swarm support and the ruflo-jujutsu plugin for Jujutsu version control, which supports worktree-style isolation. Standard git worktree support is referenced in multi-repo swarm commands.

Spec Format

Markdown (primary) — specs are written as .md files following the pattern phase_<number>_<name>.md

From sparc-spec-pseudocode.md:

"Write pseudocode as a series of md files with phase_number_name.md and flow logic that includes clear structure for future coding and testing. Split complex logic across modules. Never include hard-coded secrets or config values. Ensure each spec module remains < 500 lines."

Files Generated Per Feature

File Phase Contents
phase_1_spec.md Specification Requirements, constraints, acceptance criteria
phase_2_pseudocode.md Pseudocode Algorithmic logic, TDD anchors
phase_3_architecture.md Architecture System diagrams, API contracts
tests/<name>.test.ts Refinement TDD test suite (multiple files)
src/<feature>/<service>.ts Refinement Implementation
phase_5_completion.md Completion Docs, deployment notes
AgentDB memory entries All phases Decision records, patterns, context
06

Memory Context

Claude-Flow / Ruflo — Memory & Context

Memory Model

Hybrid: sqlite + vector-db + proprietary

The memory system is called AgentDB (package: agentdb@^3.0.0-alpha.14) backed by:

  • SQLite — primary relational store (.swarm/attestation.db for audit log, main controller state)
  • RuVector / HNSW — vector search with 384-dim embeddings (all-MiniLM-L6-v2 via ONNX), hyperbolic (Poincaré) embeddings, and RaBitQ 1-bit quantization (32× memory reduction)
  • .rvf proprietary format — RuVector Format binary file (agentdb.rvf) for compressed vector blocks

Persistence Scope

Global (cross-project) with project-scoped namespaces

From settings.json:

{
  "claudeFlow": {
    "memory": {
      "backend": "hybrid",
      "enableHNSW": true,
      "learningBridge": { "enabled": true },
      "memoryGraph": { "enabled": true },
      "agentScopes": { "enabled": true }
    },
    "learning": {
      "enabled": true,
      "autoTrain": true,
      "retention": {
        "shortTerm": "24h",
        "longTerm": "30d"
      }
    }
  }
}

Short-term memory (24h) and long-term memory (30d) are both persisted across sessions.

Context Compaction Strategy

Yes — handled via PreCompact hooks.

Two hooks intercept both manual and automatic compaction events:

  • Manual compact: Injects agent count, swarm topology options, SPARC workflow, and the "Golden Rule" (1 message = all operations) back into context before compaction
  • Auto compact: Prints the same critical constraints + agent configuration guidance

From .claude-plugin/hooks/hooks.json:

# manual PreCompact
echo "📋 IMPORTANT: Review CLAUDE.md for: 54 available agents, Swarm coordination strategies, SPARC methodology, GOLDEN RULE: 1 MESSAGE = ALL OPERATIONS"

# auto PreCompact  
echo "⚡ Apply GOLDEN RULE: Always batch operations in single messages"

Additionally, the session-end hook and Stop hook both call auto-memory-hook.mjs sync to export all memory to AgentDB before a session ends, and SessionStart calls auto-memory-hook.mjs import to restore it.

Cross-Session Handoffs

Yes — fully automated via hooks and AgentDB.

On SessionStart:

"SessionStart": [
  {
    "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" session-restore",
    "timeout": 15000
  },
  {
    "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/auto-memory-hook.mjs\" import",
    "timeout": 8000
  }
]

On Stop:

"Stop": [
  {
    "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/auto-memory-hook.mjs\" sync",
    "timeout": 10000
  }
]

From AGENTS.md:

5. ALWAYS search memory BEFORE starting: memory search --query "task"
6. ALWAYS store patterns AFTER success: memory store --namespace patterns

Memory Banks and Knowledge Bases

The AgentDB system provides 29 named controllers organized in 7 initialization levels:

Level Controllers
1 reasoningBank, hierarchicalMemory, learningBridge, hybridSearch, tieredCache
2 memoryGraph, agentMemoryScope, vectorBackend, mutationGuard, gnnService
3 skills, explainableRecall, reflexion, attestationLog, batchOperations, memoryConsolidation
4 causalGraph, nightlyLearner, learningSystem, semanticRouter
5 graphTransformer, sonaTrajectory, contextSynthesizer, rvfOptimizer, mmrDiversityRanker, guardedVectorBackend
6 federatedSession, graphAdapter

Key memory features:

  • ReasoningBank — stores reasoning traces and inference patterns
  • hierarchicalMemory — tiered storage with agent-scoped namespaces
  • causalGraph — tracks causal edges between decisions and outcomes
  • learningBridge — auto-trains on successful patterns
  • memoryConsolidation — runs on 2h daemon schedule to consolidate fragmented memory
  • attestationLog — hash-chained audit log of all mutations (.swarm/attestation.db)

The daemon workers run on schedule from settings.json:

"daemon": {
  "workers": ["map", "audit", "optimize", "consolidate", "testgaps", "ultralearn", "deepdive", "document", "refactor", "benchmark"],
  "schedules": {
    "audit": "1h",
    "optimize": "30m",
    "consolidate": "2h",
    "ultralearn": "1h"
  }
}
07

Target Tools

Claude-Flow / Ruflo — Target Tools

Primary Tool

claude-code — Claude Code CLI is the primary and native target. The entire .claude/ directory, CLAUDE.md, .claude/settings.json, hooks, MCP server configuration, and command system are built specifically for Claude Code's architecture.

Evidence from README description:

"The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features ... native Claude Code / Codex Integration"

From CLAUDE.md: References mcp__claude-flow__*, mcp__ruv-swarm__*, mcp__flow-nexus__* MCP namespaces that only work in Claude Code.


Supported Tools

1. Claude Code (claude-code)

Support level: Native, first-class

Install path:

npx claude-flow@alpha init
# Writes .claude/settings.json with hooks + MCP server config
# Copies .claude/commands/ slash commands
# Copies .claude/agents/ agent personas

Configuration: .claude/settings.json, CLAUDE.md

MCP server auto-configured:

{
  "mcpServers": {
    "claude-flow": {
      "command": "npx",
      "args": ["-y", "ruflo@latest", "mcp", "start"]
    }
  }
}

Compatibility notes: Requires CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 env var for full multi-agent team features. The skillListingBudgetFraction is set to 0.06 (6%) to handle the 367 SKILL.md files without truncation in Claude Code's skill listing budget.


2. OpenAI Codex CLI (codex)

Support level: Explicit second-class support with dedicated configuration

Install path:

# Place .agents/config.toml in project root or ~/.codex/config.toml
# Codex reads AGENTS.md for behavioral instructions

Configuration: .agents/config.toml, AGENTS.md

From .agents/config.toml:

model = "gpt-5.3-codex"
approval_policy = "on-request"
sandbox_mode = "workspace-write"

[mcp_servers.claude-flow]
command = "npx"
args = ["-y", "@claude-flow/cli@latest"]
enabled = true
tool_timeout_sec = 120

From AGENTS.md:

"claude-flow = LEDGER (tracks state, stores memory, coordinates) | Codex = EXECUTOR (writes code, runs commands, creates files)"

Compatibility notes: AGENTS.md explicitly guides Codex not to stop after calling claude-flow MCP tools — Codex executes the actual work while claude-flow tracks state.


Tools Not Explicitly Supported

The following tools are not mentioned in the README, CLAUDE.md, AGENTS.md, or configuration files and are therefore not officially supported:

  • cursor
  • aider
  • cline
  • copilot
  • opencode
  • goose
  • windsurf
  • gemini-cli
  • roo
  • kilo
  • qwen
  • jules
  • continue

Claude-Flow's architecture (Claude Code MCP server, CLAUDE.md directives, Claude Code slash commands) is deeply coupled to the Claude Code execution model. While the npm CLI could theoretically be invoked from any terminal, the swarm coordination, hook lifecycle, and MCP tool integration only function inside a Claude Code or Codex CLI session.

08

Signals

Claude-Flow / Ruflo — Signals

GitHub Stars

Repository Stars Status
ruvnet/ruflo (current) 55,218 Active (not archived)
ruvnet/claude-flow (old slug) Redirects to ruvnet/ruflo Same repo — GitHub redirects old URL

Note: Both gh api /repos/ruvnet/ruflo and gh api /repos/ruvnet/claude-flow return the same repo object (id: 995029641), confirming the rename. Stars: 55,218 as of 2026-05-26.

Last Commit Date

2026-05-26 (pushed_at from GitHub API; same day as this analysis)

Number of Contributors

24 (top contributors: ruvnet 6,193 commits, claude 50 commits, alexx-ftw 7, tommy-ca 4, lanemc 4)

Forks

6,279 forks

Open Issues

567 open issues

Reddit Sentiment

Mixed — positive endorsements of the core capability alongside criticism of claimed-but-unimplemented features and a documented security incident.

Quotes from _index/wave-2b-reddit-discovery.md:

"My favorite tool is actually Claude Flow v2 by ruvnet on GitHub and I routinely run 4-8 agents at once to swarm a problem. No usage limit." — r/LocalLLaMA (1pggss8)

"claude-flow npm package - Remote AI Behavior Injection via IPFS" / "Supply Chain Vulnerability in claude-flow npm" — r/LocalLLaMA (1r8oehn)

"claude-flow 'The leading agent orchestration platform for Claude' with 5.2k commits, but yeah, it's not fully implemented" — r/LocalLLaMA (1qnjota)

HN Sentiment

Unknown — no Hacker News references found in the wave discovery files.

Maintainer Status

Active — last push 2026-05-26 (day of analysis), 567 open issues, repo not archived, disabled: false per GitHub API.

Version progression confirms continuous development: v3.6.10 → v3.10.1 (package.json), with CLAUDE.md noting "Ruflo v3.6" as stable and v3.10.x as current on npm.

npm Package

  • Package name: claude-flow (despite repo rename to ruflo)
  • Current version: 3.10.1
  • Install: npx claude-flow@alpha or npx claude-flow@3.10.1
  • The npm package has a documented supply-chain vulnerability incident (see 09-uniqueness.md)

Related frameworks

same archetype · same primary tool · same memory type

Hermes Agent (NousResearch) ★ 168k

Self-improving personal AI agent with closed learning loop, 7 terminal backends, and messaging gateway — not tied to any AI…

OpenCode ★ 165k

Terminal-first AI coding agent with multi-model routing, native desktop app, and a typed .opencode/ configuration system for…

OpenHands ★ 75k

Open-source AI software development platform (open-source Devin alternative) with Docker sandbox isolation, 77.6% SWE-bench…

DeerFlow ★ 70k

Long-horizon superagent that researches, codes, and creates by orchestrating parallel sub-agents with isolated contexts in Docker…

oh-my-openagent (omo) ★ 60k

Multi-provider AI agent orchestration for OpenCode: escape vendor lock-in by routing Sisyphus (Claude/Kimi/GLM) and Hephaestus…

gpt-engineer ★ 55k

ARCHIVED — the original LLM-driven code generation experiment that generates entire applications from a prose specification file.