- 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>
Claude Flow Benchmark Examples
This directory contains organized examples for using the Claude Flow benchmark suite with different strategies, coordination modes, and real-world scenarios.
Directory Structure
examples/
├── basic/ # Simple examples for getting started
├── advanced/ # Complex examples with advanced features
├── real/ # Real claude-flow execution examples
├── cli/ # Command-line interface examples
└── output/ # Generated results and metrics
Basic Examples (basic/)
Getting started with simple benchmarks:
simple_swarm.py- Basic swarm coordination benchmarksimple_hive_mind.py- Basic hive-mind collective intelligencesimple_sparc.py- Basic SPARC methodology (TDD approach)claude_optimizer_example.py- Claude optimizer usageexample_usage.py- General usage patterns
Run a basic example:
cd basic/
python3 simple_swarm.py
Advanced Examples (advanced/)
Complex benchmarks with advanced features:
parallel_benchmarks.py- Concurrent execution strategiesoptimization_suite.py- Performance tuning and efficiency analysiscomparative_analysis.py- Multi-strategy comparisondemo_comprehensive.py- Comprehensive feature demonstrationparallel_benchmark_demo.py- Parallel execution patterns
Run an advanced example:
cd advanced/
python3 parallel_benchmarks.py
Real Examples (real/)
Production-ready benchmarks with actual claude-flow execution:
real_swarm_benchmark.py- Real swarm execution with comprehensive metricsreal_token_tracking.py- Token consumption analysis and cost optimizationreal_performance.py- System performance monitoring and analysisreal_hive_mind_benchmark.py- Real hive-mind collective intelligencereal_sparc_benchmark.py- Real SPARC methodology executionreal_benchmark_examples.py- Various real benchmark scenarios
Run a real example:
cd real/
python3 real_swarm_benchmark.py
CLI Examples (cli/)
Command-line interface demonstrations:
cli_examples.sh- Comprehensive CLI usage examplesbatch_benchmarks.sh- Batch execution scripts
Run CLI examples:
cd cli/
./cli_examples.sh
Run batch benchmarks:
cd cli/
./batch_benchmarks.sh
Quick Start
1. Simple Swarm Benchmark
python3 basic/simple_swarm.py
2. Real Performance Analysis
python3 real/real_performance.py
3. Token Tracking and Cost Analysis
python3 real/real_token_tracking.py
4. Comprehensive CLI Demo
./cli/cli_examples.sh
Example Types by Use Case
Learning and Testing
basic/simple_*.py- Start here for learningcli/cli_examples.sh- Command-line reference
Development and Optimization
advanced/optimization_suite.py- Performance tuningreal/real_performance.py- System monitoringreal/real_token_tracking.py- Cost optimization
Production Assessment
real/real_swarm_benchmark.py- Production readinessadvanced/comparative_analysis.py- Strategy comparisoncli/batch_benchmarks.sh- Automated testing
Research and Analysis
advanced/parallel_benchmarks.py- Concurrent executionreal/real_hive_mind_benchmark.py- Collective intelligenceadvanced/comparative_analysis.py- Multi-methodology comparison
Output and Results
All examples save results to the output/ directory with timestamps:
output/
├── simple_swarm_metrics.json
├── parallel_benchmark_results.json
├── token_tracking_metrics_*.json
├── performance_analysis_*.json
└── batch_results_*/
Requirements
Python Dependencies:
pip install psutil # For system monitoring
Claude Flow:
npm install -g claude-flow@alpha
Benchmark Suite:
pip install -e . # From benchmark root directory
Configuration
Most examples can be configured by modifying parameters at the top of each script:
# Example configuration
config = {
"agents": 5,
"coordination": "hierarchical",
"strategy": "development",
"timeout": 180
}
Best Practices
- Start Simple: Begin with
basic/examples - Monitor Resources: Use
real/real_performance.pyfor system analysis - Track Costs: Use
real/real_token_tracking.pyfor cost optimization - Compare Strategies: Use
advanced/comparative_analysis.py - Automate Testing: Use
cli/batch_benchmarks.sh
Integration with CI/CD
Use batch scripts for automated testing:
# GitHub Actions example
- name: Run Benchmark Suite
run: |
cd benchmark/examples/cli/
./batch_benchmarks.sh
- name: Upload Results
uses: actions/upload-artifact@v3
with:
name: benchmark-results
path: benchmark/examples/output/
Troubleshooting
Common Issues:
- Command not found: Ensure
claude-flow@alphais installed globally - Permission denied: Run
chmod +x cli/*.sh - Import errors: Install with
pip install -e .from benchmark root - Timeout errors: Increase timeout values in configurations
Debug Mode:
Add --debug flag to commands for verbose output:
python3 real/real_swarm_benchmark.py --debug
Contributing
To add new examples:
- Choose appropriate directory (
basic/,advanced/,real/,cli/) - Follow naming convention:
{purpose}_{type}_{description}.py - Include comprehensive docstrings and comments
- Save outputs to
output/directory with timestamps - Update this README with usage instructions
Support
- Documentation:
/workspaces/claude-code-flow/benchmark/docs/ - Issues: Create GitHub issues with example logs
- Community: Join discussions in GitHub Discussions
Next Steps:
- Try basic examples to understand concepts
- Run real examples for production insights
- Use CLI examples for automation
- Customize advanced examples for specific needs