AI & Agents

How to Set Up Claude Flow for Multi-Agent Code Orchestration

Claude Flow passed 710,000 lifetime npm downloads by mid-2026, making it the most-installed community orchestrator for Claude Code despite Anthropic shipping its own multi-agent API three months earlier. Developers keep reaching for it because it provides cross-session memory, the SPARC test-driven methodology, and multi-provider routing that the official API does not yet offer.

Fast.io Editorial Team 13 min read
AI agents coordinating development tasks in a shared workspace

What Claude Flow Is and Why Developers Still Install It

Claude Flow passed 710,000 lifetime npm downloads by May 2026, with roughly 52,000 weekly installs across its two package names. That adoption is notable because Anthropic shipped its own Managed Agents API just three months earlier. Developers keep reaching for Claude Flow because it solves problems the official API does not yet address: persistent cross-session memory, structured TDD workflows, and multi-provider routing that works with models beyond Claude.

Claude Flow is a community-built orchestration layer, created by Reuven Cohen, that sits on top of Claude Code. Rather than running one agent at a time, it coordinates up to 10 specialized agents working in parallel on a shared codebase. Each agent gets a defined role (researcher, coder, reviewer, tester) and operates within a hierarchical coordination system the project calls the "hive mind."

The project was renamed to Ruflo in January 2026 after a trademark conversation with Anthropic. The npm registry carries the same codebase under both claude-flow and ruflo, and both resolve to the same v3.6.x release. Most community discussions still reference the original name, so this guide uses Claude Flow throughout.

At its core, Claude Flow is a Node.js CLI that spawns and coordinates Claude Code sessions. You define a task, the orchestrator breaks it into subtasks, assigns each to a specialized agent, manages their shared memory, and combines their output. The coordination happens through a local SQLite database and JSON-based messaging, not through an external service.

For teams building Claude Cowork workflows where multiple agents collaborate on shared files, Claude Flow provides the orchestration layer that prevents agents from stepping on each other's work. It handles task routing, conflict resolution, and quality gates so the agents can focus on their assigned roles.

How to Install and Initialize Claude Flow

Claude Flow requires Node.js v18 or later (v22 is recommended and tested), npm v9 or later, and Claude Code v2.1.0 or above. You also need a valid Anthropic API key set in your environment.

The fast way to get started is a global install:

npm install -g claude-flow

Then initialize a project with SPARC mode enabled:

claude-flow init --sparc

This creates a .claude/ directory in your project root with configuration files, agent prompts, and a settings.json tuned for automation. The default configuration sets a 5-minute command timeout, enables all tools with wildcard permissions, and turns on parallel execution.

If you prefer not to install globally, use npx:

npx claude-flow@latest init --sparc

Once initialized, start the orchestration daemon:

claude-flow daemon start

The daemon manages agent lifecycle, task queuing, and the shared memory store. You can verify everything is working with the status command:

claude-flow status

This prints system health metrics including active agent count, memory store size, and daemon uptime.

Key CLI Commands

  • claude-flow swarm init starts a multi-agent swarm with configurable worker count and topology
  • claude-flow sparc run [mode] executes a specific SPARC development workflow
  • claude-flow memory store and claude-flow memory query manage the persistent knowledge bank
  • claude-flow task create adds tasks to the orchestration queue
  • claude-flow monitor opens the real-time monitoring dashboard

Configuration

The init command generates a .claude/settings.json with defaults suited for autonomous operation. The key settings to review:

{
  "commandTimeout": 300000,
  "maxOutputSize": 500000,
  "parallelExecution": true,
  "batchOperations": true,
  "autoSaveMemory": true
}

commandTimeout controls how long a single agent command can run before the daemon kills it. The default 5 minutes works for most tasks, but long-running test suites may need more. maxOutputSize caps agent output at 500KB to prevent context window saturation. autoSaveMemory writes agent decisions to the memory bank after each step, which is critical for cross-session persistence.

You can also select the swarm topology during initialization. Claude Flow supports hierarchical (tight central control), mesh (peer-to-peer collaboration), and adaptive (dynamic reconfiguration based on workload). Hierarchical is the safest default for teams getting started.

Configuration and monitoring dashboard for AI agent workflows

The SPARC Framework and Agent Modes

SPARC stands for Specification, Pseudocode, Architecture, Refinement, and Completion. It is the structured development methodology Claude Flow applies to every task. Rather than letting agents work in a free-form loop, SPARC enforces sequential gates: no code gets written until the specification and pseudocode stages pass review, and no code is merged until tests prove it works.

How the Five Stages Work

Specification. The orchestrator analyzes the incoming task and produces formal requirements. This includes input/output definitions, constraints, and acceptance criteria. The goal is to catch ambiguity before any agent starts coding.

Pseudocode. Before writing real code, agents produce pseudocode that describes the logic in plain language. This catches architectural mistakes early, before anyone spends tokens on implementation details.

Architecture. Agents design the system structure: file layout, module boundaries, integration points, and data flow. The Architect worker handles this stage and produces a blueprint that downstream agents follow.

Refinement. This is the implementation stage. Coder agents write the actual code under a strict TDD constraint: they must write failing tests first, then write the minimum code to make the tests pass, then refactor. The Reviewer worker acts as gatekeeper, rejecting code that violates style rules or skips test coverage.

Completion. Final integration, documentation, and quality checks. The Documenter worker produces inline comments and API documentation. The full test suite runs one final time before the orchestrator marks the task complete.

The Hive-Mind Hierarchy

Claude Flow organizes agents into a hierarchy inspired by insect colonies. At the top sit three types of coordinating entities called "queens":

  • Strategic queens handle high-level planning and role assignment across the swarm
  • Tactical queens manage execution, resolve conflicts between workers, and handle error recovery
  • Adaptive queens monitor runtime performance and reconfigure the swarm topology when bottlenecks appear

Below the queens, eight worker types execute the actual development tasks:

  • Researcher gathers context, reads documentation, and searches for prior art
  • Architect designs system structure and module boundaries
  • Coder writes implementation code under TDD constraints
  • Tester creates and runs test suites
  • Reviewer inspects code quality and enforces style rules
  • Analyst examines data, metrics, and runtime logs
  • Optimizer improves performance of existing code
  • Documenter writes documentation and API references

Security analysis operates through dedicated plugins rather than a separate worker type, which keeps security tooling modular and upgradable independently of the core agent pipeline.

Memory and Cross-Session Persistence

Claude Flow stores everything in a local SQLite database with HNSW vector embeddings for fast semantic retrieval. The memory system has three layers:

  • Knowledge graph captures entities and relationships discovered in the codebase
  • ReasoningBank stores successful solution patterns so agents can recall what worked before
  • SONA learning loop applies multi-armed bandit optimization to route future tasks toward the agents and strategies that performed best in previous runs

This means an agent swarm that refactored your authentication module last Tuesday can recall those decisions when you ask it to add OAuth support today. Cross-session memory is what separates Claude Flow from tools that start from scratch every time.

AI-powered analysis pipeline with structured quality gates
Fastio features

Give your multi-agent pipeline a shared workspace

Fast.io workspaces provide versioned file storage with built-in semantic search and an MCP endpoint that any agent in your swarm can read from and write to. Starts with a 14-day free trial.

Claude Flow vs. Anthropic's Built-In Multi-Agent API

Anthropic launched the Managed Agents API in early 2026, giving developers a first-party way to coordinate multiple Claude agents. Understanding where Claude Flow and the official API overlap helps you pick the right tool for each job.

What the Managed Agents API Provides

The official API uses a coordinator pattern. You define a coordinator agent with a roster of specialized agents, each running in its own session thread with isolated context. All agents share the same sandbox and filesystem. The coordinator delegates tasks, collects results, and synthesizes the output.

Key capabilities:

  • Up to 25 concurrent session threads per session
  • Each agent gets its own model, system prompt, tools, and MCP servers
  • Persistent threads that retain context across follow-up messages within a session
  • Built-in tool permission management and event streaming
  • First-party support with no additional dependencies or packages to install

Where Claude Flow Differs

Cross-session memory. The Managed Agents API provides persistent threads within a session, but does not carry learned patterns or codebase knowledge between separate sessions. Claude Flow's SQLite-backed memory bank persists across runs, days, and projects.

Structured development methodology. SPARC enforces TDD gates, specification reviews, and quality checkpoints at every stage. The official API provides raw coordination primitives. You can build structured workflows on top of it, but you write that logic yourself.

Multi-provider routing. Claude Flow routes work across Claude, GPT, Gemini, Cohere, and Ollama. It implements a cost-optimization strategy that starts with cheaper model tiers and escalates to more capable models only when needed. The official API works exclusively with Claude models.

Consensus algorithms. Claude Flow implements Raft, Byzantine, Gossip, CRDT, and Quorum consensus models for fault tolerance in large swarms. This matters when running 8-10 agents that need to agree on shared state. The official API handles coordination through the single coordinator pattern without explicit consensus mechanisms.

When to Use Which

Use the Managed Agents API when you need a production-grade, first-party solution with minimal setup. It is the right choice for applications deployed to production that require API-level reliability and direct Anthropic support.

Use Claude Flow when your development workflow needs cross-session memory, structured TDD pipelines, multi-provider routing, or the SPARC methodology. It excels at overnight refactoring jobs, large migration projects, and scenarios where agents need to recall decisions from prior runs.

Many teams use both. The Managed Agents API handles production workloads and customer-facing agent systems while Claude Flow drives internal development automation and codebase maintenance.

Running Claude Flow in a Claude Cowork Environment

Claude Flow stores its coordination state locally in SQLite. That works well for solo development, but it creates friction when multiple developers need access to the same agent output. The generated code lives in git, but the research artifacts, audit logs, and intermediate analysis that agents produce during a SPARC run often have no permanent home outside the machine that ran them.

The Team Persistence Problem

A developer who kicks off an overnight refactoring job from their laptop can review the results the next morning. Their teammate on a different machine has no access to the agent's reasoning trail, discarded approaches, or quality reports. In multi-agent coworking setups where several people rely on the same agent pipeline, this gap slows everyone down.

Storage Options for Agent Output

Several approaches solve the persistence problem:

Git repositories work for code output but handle large binary artifacts, research documents, and media files poorly. Git was designed for source code, not for the full breadth of what a 10-agent SPARC pipeline produces.

S3 or GCS buckets provide raw storage at scale but offer no search, no file-level versioning UI, and no built-in way for agents to query what they stored last week.

Fast.io workspaces provide shared storage where agents and humans access the same files through the same intelligence layer. When Intelligence Mode is enabled on a workspace, every file an agent uploads is automatically indexed for semantic search and RAG chat. A developer can ask "What approach did the architect agent take for the auth module?" and get a cited answer pulled from the agent's own output documents.

Fast.io exposes a consolidated MCP toolset at /storage-for-agents/, which means Claude Code agents (and by extension, Claude Flow workers) can read from and write to shared workspaces without custom integration code. The append-only audit log tracks every file operation, providing a complete record of which agent created or modified each file.

Connecting the Pipeline to Shared Storage

The typical workflow: Claude Flow runs locally and produces output. At the end of each SPARC completion stage, a post-pipeline script copies the relevant artifacts to shared storage. For Fast.io, this could be an upload through the API or MCP tools. For S3, a sync command. The key is treating the local SQLite database as a working cache and the shared workspace as the permanent record.

Version history matters here. When an optimizer agent rewrites a module three times across three runs, you want all three versions accessible, not just the latest. Fast.io's per-file version history handles this automatically. So does git, but only for text files that were committed to the repo.

Frequently Asked Questions

What is Claude Flow?

Claude Flow is an open-source, community-built orchestration platform that coordinates multiple Claude Code agents working in parallel. It uses a hive-mind architecture with specialized agent roles and the SPARC development methodology to enforce structured, test-driven workflows. The project was renamed to Ruflo in January 2026 after a trademark discussion with Anthropic, though the npm package still publishes under both names. It is MIT-licensed and available via npm.

How does Claude Flow differ from Claude Code subagents?

Claude Code's built-in subagents run within a single session and share the parent's context window. Claude Flow operates at a higher level, spawning and coordinating up to 10 separate Claude Code sessions simultaneously. It adds cross-session memory persistence in SQLite, structured SPARC development gates, multi-provider routing across Claude, GPT, Gemini, Cohere, and Ollama, and consensus algorithms for fault tolerance. Anthropic's Managed Agents API supports up to 25 concurrent threads but does not provide cross-session memory or a built-in development methodology.

How do you install and configure Claude Flow?

Install globally with npm install -g claude-flow, then run claude-flow init --sparc in your project directory. This creates configuration files and SPARC-optimized settings. You need Node.js v18 or later, npm v9 or later, and Claude Code v2.1.0 or above. Start the orchestration daemon with claude-flow daemon start and verify the setup with claude-flow status.

What are SPARC agent modes in Claude Flow?

SPARC stands for Specification, Pseudocode, Architecture, Refinement, and Completion. It structures development into five sequential stages with quality gates between each. No code gets written until specification and pseudocode stages pass review, and all implementation follows test-driven development rules. Claude Flow implements SPARC through eight specialized worker types (Researcher, Architect, Coder, Tester, Reviewer, Analyst, Optimizer, Documenter) coordinated by three queen types that manage planning, execution, and performance monitoring.

Is Claude Flow free to use?

Yes. Claude Flow is MIT-licensed and free to install from npm. Running it requires API access to at least one LLM provider, typically Anthropic's API for Claude models, and those API calls are billed by the provider at their standard rates. The orchestration layer itself adds no additional cost.

Can Claude Flow work with models other than Claude?

Claude Flow supports multi-provider routing across Claude, GPT, Gemini, Cohere, and Ollama. It implements a cost-optimization strategy that routes simpler tasks to cheaper model tiers first and escalates to more capable models when the task requires it. This is one of its key differentiators from Anthropic's official Managed Agents API, which works exclusively with Claude models.

What happened to the Claude Flow name?

The project was renamed to Ruflo in January 2026 following a trademark discussion with Anthropic. The npm packages claude-flow and ruflo both publish the same codebase at the same version, and both CLI names continue to work. The GitHub repository moved to the ruvnet/ruflo namespace. Community documentation still widely uses the original Claude Flow name.

Related Resources

Fastio features

Give your multi-agent pipeline a shared workspace

Fast.io workspaces provide versioned file storage with built-in semantic search and an MCP endpoint that any agent in your swarm can read from and write to. Starts with a 14-day free trial.