Files
ruflo/v2/examples/06-tutorials/getting-started/01-first-swarm.md
T
rUvandClaude Opus 4.5 1b6a1971f7 feat(v3): add comprehensive v3 implementation plans and swarm architecture
- Reorganize v3/ into implementation/ subfolders:
  - planning/, architecture/, migration/, integration/
  - security/, adrs/, research/, swarm-plans/

- Add 15-agent concurrent swarm implementation plans:
  - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases
  - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities
  - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology
  - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x)
  - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback
  - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies

- Update .claude/settings.json with proper hooks format
- Add bash aliases for claude --dangerously-skip-permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 15:40:51 +00:00

2.9 KiB

Your First Claude Flow Swarm

This tutorial will guide you through creating your first swarm and understanding how Claude Flow works.

Prerequisites

  • Claude Flow installed (npm install -g claude-flow)
  • Basic command line knowledge
  • Node.js 18+ installed

Step 1: Understanding Swarms

A swarm is a coordinated group of AI agents working together to complete a task. Each agent has specific capabilities and roles.

Step 2: Create a Simple Swarm

Let's create a basic "Hello World" application:

cd examples
../claude-flow swarm create "Build a hello world CLI application" \
  --name my-first-swarm \
  --output ./output/hello-world

What happens:

  1. Claude Flow creates a swarm coordinator
  2. Assigns agents based on the task
  3. Agents work together to build the application
  4. Output is saved to the specified directory

Step 3: Examine the Output

cd ./output/hello-world
ls -la

You should see:

  • index.js - Main application file
  • package.json - Node.js configuration
  • README.md - Documentation
  • test.js - Test file (if tests were requested)

Step 4: Run Your Application

npm install  # Install any dependencies
npm start    # Run the application

Step 5: Understanding Agent Roles

Check the swarm logs to see how agents collaborated:

cat ../../logs/swarm-*.log

You'll see agents like:

  • Analyzer: Understood requirements
  • Developer: Wrote the code
  • Documenter: Created README
  • Tester: Added tests

Step 6: Customizing Your Swarm

Try with more specific requirements:

../claude-flow swarm create \
  "Build a CLI calculator that supports add, subtract, multiply, divide" \
  --agents 3 \
  --strategy development \
  --name calculator-swarm

Parameters explained:

  • --agents 3: Use 3 specialized agents
  • --strategy development: Focus on code creation
  • --name: Give your swarm a memorable name

Next Steps

  1. Try different strategies:

    • research: For gathering information
    • analysis: For code review
    • testing: For test creation
    • optimization: For performance improvements
  2. Use configuration files:

    ../claude-flow swarm create "Your task" \
      --config ../01-configurations/basic/simple-config.json
    
  3. Monitor swarm progress:

    ../claude-flow swarm create "Your task" --monitor
    

Common Issues

Problem: Swarm takes too long

  • Solution: Use --timeout 60000 to set limits

Problem: Not enough detail in output

  • Solution: Be more specific in your task description

Problem: Want different output structure

  • Solution: Include structure requirements in your prompt

Summary

You've learned to:

  • ✅ Create a basic swarm
  • ✅ Understand agent collaboration
  • ✅ Customize swarm behavior
  • ✅ Run generated applications

Continue to Tutorial 2: Working with Workflows