Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Comprehensive performance analysis suite for identifying bottlenecks, profiling swarm operations, generating detailed reports, and providing actionable optimization recommendations.
.claude/skills/performance-analysis/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | — | — |
| case-03 | ✗→✓ | ▲ Improved | — | — |
| case-05 | ✗→✓ | ▲ Improved | — | — |
| case-08 | ✗→✓ | ▲ Improved | — | — |
| case-07 | ✗→✓ | ▲ Improved | — | — |
Comprehensive performance analysis suite for identifying bottlenecks, profiling swarm operations, generating detailed reports, and providing actionable optimization recommendations.
This skill consolidates all performance analysis capabilities:
bashnpx claude-flow bottleneck detect
bashnpx claude-flow analysis performance-report --format html --include-metrics
bashnpx claude-flow bottleneck detect --fix --threshold 15
bashnpx claude-flow bottleneck detect [options]
--swarm-id, -s <id> - Analyze specific swarm (default: current)--time-range, -t <range> - Analysis period: 1h, 24h, 7d, all (default: 1h)--threshold <percent> - Bottleneck threshold percentage (default: 20)--export, -e <file> - Export analysis to file--fix - Apply automatic optimizationsbash# Basic detection for current swarm npx claude-flow bottleneck detect # Analyze specific swarm over 24 hours npx claude-flow bottleneck detect --swarm-id swarm-123 -t 24h # Export detailed analysis npx claude-flow bottleneck detect -t 24h -e bottlenecks.json # Auto-fix detected issues npx claude-flow bottleneck detect --fix --threshold 15 # Low threshold for sensitive detection npx claude-flow bottleneck detect --threshold 10 --export critical-issues.json
Communication Bottlenecks:
Processing Bottlenecks:
Memory Bottlenecks:
Network Bottlenecks:
🔍 Bottleneck Analysis Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Summary
├── Time Range: Last 1 hour
├── Agents Analyzed: 6
├── Tasks Processed: 42
└── Critical Issues: 2
🚨 Critical Bottlenecks
1. Agent Communication (35% impact)
└── coordinator → coder-1 messages delayed by 2.3s avg
2. Memory Access (28% impact)
└── Neural pattern loading taking 1.8s per access
⚠️ Warning Bottlenecks
1. Task Queue (18% impact)
└── 5 tasks waiting > 10s for assignment
💡 Recommendations
1. Switch to hierarchical topology (est. 40% improvement)
2. Enable memory caching (est. 25% improvement)
3. Increase agent concurrency to 8 (est. 20% improvement)
✅ Quick Fixes Available
Run with --fix to apply:
- Enable smart caching
- Optimize message routing
- Adjust agent prioritiesAutomatic analysis during task execution:
Time Bottlenecks:
Coordination Bottlenecks:
Resource Bottlenecks:
javascript// Check for bottlenecks in Claude Code mcp__claude-flow__bottleneck_detect({ timeRange: "1h", threshold: 20, autoFix: false }) // Get detailed task results with bottleneck analysis mcp__claude-flow__task_results({ taskId: "task-123", format: "detailed" })
Result Format:
json{ "bottlenecks": [ { "type": "coordination", "severity": "high", "description": "Single agent used for complex task", "recommendation": "Spawn specialized agents for parallel work", "impact": "35%", "affectedComponents": ["coordinator", "coder-1"] } ], "improvements": [ { "area": "execution_time", "suggestion": "Use parallel task execution", "expectedImprovement": "30-50% time reduction", "implementationSteps": [ "Split task into smaller units", "Spawn 3-4 specialized agents", "Use mesh topology for coordination" ] } ], "metrics": { "avgExecutionTime": "142s", "agentUtilization": "67%", "cacheHitRate": "82%", "parallelizationFactor": 1.2 } }
bashnpx claude-flow analysis performance-report [options]
--format <type> - Report format: json, html, markdown (default: markdown)--include-metrics - Include detailed metrics and charts--compare <id> - Compare with previous swarm--time-range <range> - Analysis period: 1h, 24h, 7d, 30d, all--output <file> - Output file path--sections <list> - Comma-separated sections to includebash# Generate HTML report with all metrics npx claude-flow analysis performance-report --format html --include-metrics # Compare current swarm with previous npx claude-flow analysis performance-report --compare swarm-123 --format markdown # Custom output with specific sections npx claude-flow analysis performance-report \ --sections summary,metrics,recommendations \ --output reports/perf-analysis.html \ --format html # Weekly performance report npx claude-flow analysis performance-report \ --time-range 7d \ --include-metrics \ --format markdown \ --output docs/weekly-performance.md # JSON format for CI/CD integration npx claude-flow analysis performance-report \ --format json \ --output build/performance.json
markdown# Performance Analysis Report ## Executive Summary - **Overall Score**: 87/100 - **Analysis Period**: Last 24 hours - **Swarms Analyzed**: 3 - **Critical Issues**: 1 ## Key Metrics | Metric | Value | Trend | Target | |--------|-------|-------|--------| | Avg Task Time | 42s | ↓ 12% | 35s | | Agent Utilization | 78% | ↑ 5% | 85% | | Cache Hit Rate | 91% | → | 90% | | Parallel Efficiency | 2.3x | ↑ 0.4x | 2.5x | ## Bottleneck Analysis ### Critical 1. **Agent Communication Delay** (Impact: 35%) - Coordinator → Coder messages delayed by 2.3s avg - **Fix**: Switch to hierarchical topology ### Warnings 1. **Memory Access Pattern** (Impact: 18%) - Neural pattern loading: 1.8s per access - **Fix**: Enable memory caching ## Recommendations 1. **High Priority**: Switch to hierarchical topology (40% improvement) 2. **Medium Priority**: Enable memory caching (25% improvement) 3. **Low Priority**: Increase agent concurrency to 8 (20% improvement)
When using --fix, the following optimizations may be applied:
1. Topology Optimization
2. Caching Enhancement
3. Concurrency Tuning
4. Priority Adjustment
5. Resource Optimization
Typical improvements after bottleneck resolution:
bash# Monitor performance in real-time npx claude-flow swarm monitor --interval 5 # Generate hourly reports while true; do npx claude-flow analysis performance-report \ --format json \ --output logs/perf-$(date +%Y%m%d-%H%M).json sleep 3600 done
yaml# .github/workflows/performance.yml name: Performance Analysis on: [push, pull_request] jobs: analyze: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Run Performance Analysis run: | npx claude-flow analysis performance-report \ --format json \ --output performance.json - name: Check Performance Thresholds run: | npx claude-flow bottleneck detect \ --threshold 15 \ --export bottlenecks.json - name: Upload Reports uses: actions/upload-artifact@v2 with: name: performance-reports path: | performance.json bottlenecks.json
javascript// scripts/analyze-performance.js const { exec } = require('child_process'); const fs = require('fs'); async function analyzePerformance() { // Run bottleneck detection const bottlenecks = await runCommand( 'npx claude-flow bottleneck detect --format json' ); // Generate performance report const report = await runCommand( 'npx claude-flow analysis performance-report --format json' ); // Analyze results const analysis = { bottlenecks: JSON.parse(bottlenecks), performance: JSON.parse(report), timestamp: new Date().toISOString() }; // Save combined analysis fs.writeFileSync( 'analysis/combined-report.json', JSON.stringify(analysis, null, 2) ); // Generate alerts if needed if (analysis.bottlenecks.critical.length > 0) { console.error('CRITICAL: Performance bottlenecks detected!'); process.exit(1); } } function runCommand(cmd) { return new Promise((resolve, reject) => { exec(cmd, (error, stdout, stderr) => { if (error) reject(error); else resolve(stdout); }); }); } analyzePerformance().catch(console.error);
High Memory Usage
bash# Analyze memory bottlenecks npx claude-flow bottleneck detect --threshold 10 # Check cache performance npx claude-flow cache manage --action stats # Review memory metrics npx claude-flow memory usage
Slow Task Execution
bash# Identify slow tasks npx claude-flow task status --detailed # Analyze coordination overhead npx claude-flow bottleneck detect --time-range 1h # Check agent utilization npx claude-flow agent metrics
Poor Cache Performance
bash# Analyze cache hit rates npx claude-flow analysis performance-report --sections metrics # Review cache strategy npx claude-flow cache manage --action analyze # Enable cache warming npx claude-flow bottleneck detect --fix
npx claude-flow swarm monitor - Real-time monitoringnpx claude-flow token usage - Token optimization analysisnpx claude-flow cache manage - Cache optimizationnpx claude-flow agent metrics - Agent performance metricsnpx claude-flow task status - Task execution analysisVersion: 1.0.0 Last Updated: 2025-10-19 Maintainer: Claude Flow Team
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 17 counted toward the lift figure. The other 5 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 17 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.