worker-benchmarks — Claude Code skill: benchmark your workers
Runs the agentic-flow worker benchmark suite: trigger detection, registry CRUD, agent selection, model cache and concurrent workers. Useful when you need numbers instead of guesses.
npx skills add ruvnet/ruflo --skill worker-benchmarks -a claude-codeWhat worker-benchmarks does
The skill wraps npx agentic-flow workers benchmark. Called without flags it runs every test; --type narrows it to one of trigger-detection, registry, agent-selection, concurrent, cache or memory-keys. Each test reports average latency, p95, throughput and memory delta, then a summary counts passed and failed checks.
Thresholds live in .claude/settings.json under performance.benchmarkThresholds — p95 of 5 ms for trigger detection, 10 ms for the registry, 1 ms for agent selection, 0.1 ms for memory key generation, 1000 ms total for concurrent workers. Edit those values and the run measures against your numbers.
From TypeScript you can import workerBenchmarks and runBenchmarks out of agentic-flow/workers/worker-benchmarks and call individual benchmarks with your own iteration counts. The README lists three environment variables that speed things up: CLAUDE_FLOW_MODEL_CACHE_MB=512, CLAUDE_FLOW_WORKER_PARALLEL=true and CLAUDE_FLOW_SUPPRESS_WARNINGS=true. SQLite WAL mode is on by default. Nothing runs without the agentic-flow package present.
What it helps with
- measure how fast worker triggers are detected
- time the create, read and update calls on the worker registry
- check the latency of performance-based agent selection
- inspect model cache hit rate and eviction stats
- compare ten parallel workers on time and memory
Example prompts for the agent
- Run the full worker benchmark suite
- Run only
--type agent-selectionand show me the p95 - Compare the
registryresults against the thresholds in.claude/settings.json
How to install worker-benchmarks
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill worker-benchmarks -a claude-code2Manually: put the files in place
~/.claude/skills/worker-benchmarks/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/worker-benchmarks/
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill worker-benchmarks -a codex2Manually: put the files in place
.agents/skills/worker-benchmarks/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill worker-benchmarks -a cursor2Manually: put the files in place
.cursor/skills/worker-benchmarks/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ruvnet/ruflo worker-benchmarks2Manually: put the files in place
.github/skills/worker-benchmarks/SKILL.md1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill worker-benchmarks -a gemini-cli2Platform CLI
gemini skills install https://github.com/ruvnet/ruflo --path .claude/skills/worker-benchmarksManually: put the files in place
.devin/skills/worker-benchmarks/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill worker-benchmarks -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about worker-benchmarks
How do I install worker-benchmarks in Claude Code?
Run npx skills add ruvnet/ruflo --skill worker-benchmarks -a claude-code, then check ~/.claude/skills/worker-benchmarks/SKILL.md.
What does worker-benchmarks do?
It benchmarks the agentic-flow worker system: trigger detection, the worker registry, agent selection, model caching, concurrent workers and memory key generation.
Where are the benchmark thresholds defined?
In the performance.benchmarkThresholds block of .claude/settings.json. It holds p95 targets for trigger detection, the registry, agent selection and memory keys, plus a total time for concurrent workers.
Source text
SKILL.md · MIT
---
name: worker-benchmarks
description: Run comprehensive worker system benchmarks and performance analysis
user-invocable: true
---
# Worker Benchmarks Skill
Run comprehensive performance benchmarks for the agentic-flow worker system.
## Quick Start
```bash
# Run full benchmark suite
npx agentic-flow workers benchmark
# Run specific benchmark
npx agentic-flow workers benchmark --type trigger-detection
npx agentic-flow workers benchmark --type registry
npx agentic-flow workers benchmark --type agent-selection
npx agentic-flow workers benchmark --type concurrent
```
## Benchmark Types
### 1. Trigger Detection (`trigger-detection`)
Tests keyword detection speed across 12 worker triggers.
- **Target**: p95 < 5ms
- **Iterations**: 1000
- **Metrics**: latency, throughput, histogram
### 2. Worker Registry (`registry`)
Tests CRUD operations on worker entries.
- **Target**: p95 < 10ms
- **Iterations**: 500 creates, gets, updates
- **Metrics**: per-operation latency breakdown
### 3. Agent Selection (`agent-selection`)
Tests performance-based agent selection.
- **Target**: p95 < 1ms
- **Iterations**: 1000
- **Metrics**: selection confidence, agent scores
### 4. Model Cache (`cache`)
Tests model caching performance.
- **Target**: p95 < 0.5ms
- **Metrics**: hit rate, cache size, eviction stats
### 5. Concurrent Workers (`concurrent`)
Tests parallel worker creation and updates.
- **Target**: < 1000ms for 10 workers
- **Metrics**: per-worker latency, memory usage
### 6. Memory Key Generation (`memory-keys`)
Tests memory pattern key generation.
- **Target**: p95 < 0.1ms
- **Iterations**: 5000
- **Metrics**: unique patterns, throughput
## Output Format
```
═══════════════════════════════════════════════════════════
📈 BENCHMARK RESULTS
═══════════════════════════════════════════════════════════
✅ Trigger Detection
Operation: detect
Count: 1,000
Avg: 0.045ms | p95: 0.120ms (target: 5ms)
Throughput: 22,222 ops/s
Memory Δ: 0.12MB
✅ Worker Registry
Operation: crud
Count: 1,500
Avg: 1.234ms | p95: 3.456ms (target: 10ms)
Throughput: 810 ops/s
Memory Δ: 2.34MB
───────────────────────────────────────────────────────────
📊 SUMMARY
───────────────────────────────────────────────────────────
Total Tests: 6
Passed: 6 | Failed: 0
Avg Latency: 0.567ms
Total Duration: 2345ms
Peak Memory: 8.90MB
═══════════════════════════════════════════════════════════
```
## Integration with Settings
Benchmark thresholds are configured in `.claude/settings.json`:
```json
{
"performance": {
"benchmarkThresholds": {
"triggerDetection": { "p95Ms": 5 },
"workerRegistry": { "p95Ms": 10 },
"agentSelection": { "p95Ms": 1 },
"memoryKeyGeneration": { "p95Ms": 0.1 },
"concurrentWorkers": { "totalMs": 1000 }
}
}
}
```
## Programmatic Usage
```typescript
import { workerBenchmarks, runBenchmarks } from 'agentic-flow/workers/worker-benchmarks';
// Run full suite
const suite = await runBenchmarks();
console.log(suite.summary);
// Run individual benchmarks
const triggerResult = await workerBenchmarks.benchmarkTriggerDetection(1000);
const registryResult = await workerBenchmarks.benchmarkRegistryOperations(500);
```
## Performance Optimization Tips
1. **Model Cache**: Enable with `CLAUDE_FLOW_MODEL_CACHE_MB=512`
2. **Parallel Workers**: Enable with `CLAUDE_FLOW_WORKER_PARALLEL=true`
3. **Warning Suppression**: Enable with `CLAUDE_FLOW_SUPPRESS_WARNINGS=true`
4. **SQLite WAL Mode**: Automatic for better concurrent performance
© ruvnet · MIT · ruvnet/ruflo