
Benchmark Optimization Loop
- 1.4k installs
- 238k repo stars
- Updated August 5, 2026
- affaan-m/everything-claude-code
benchmark-optimization-loop is a Claude Code skill that converts vague performance requests into measurable, bounded optimization loops that improve latency, throughput, or cost while preserving correctness.
About
benchmark-optimization-loop is a performance engineering skill from Everything Claude Code for developers who hear requests like "make it 20x faster" or "try dozens of recursive optimizations" and need a disciplined measurement loop instead of random tweaks. The skill requires a defined operation, a correctness gate that must stay green, and an explicit metric such as wall time, p95 latency, rows per second, cost per run, or memory before any change lands. Agents use Read, Write, Edit, Bash, Grep, and Glob to implement variants, run repeated benchmarks, and select the best measured implementation. Developers reach for this skill when optimization must be evidence-backed rather than intuition-driven.
- Converts "make it 20x faster" or "try 50 recursive optimizations" into a repeatable measured loop
- Enforces 5-item Required Baseline before any optimization begins
- 8-step optimization loop with explicit correctness, safety and reproducibility gates
- Generates and tracks variant comparison tables with hypothesis, command, time, correctness and notes
- Codifies the winning implementation into script, test, config or documentation
Benchmark Optimization Loop by the numbers
- 1,436 all-time installs (skills.sh)
- +219 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #821 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/affaan-m/everything-claude-code --skill benchmark-optimization-loopAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1.4k |
|---|---|
| repo stars | ★ 238k |
| Last updated | August 5, 2026 |
| Repository | affaan-m/everything-claude-code ↗ |
How do you benchmark code optimizations with correctness gates?
Systematically turn vague performance requests into measurable, bounded optimization loops that improve latency, throughput or cost while preserving correctness.
Who is it for?
Developers optimizing hot paths who already have tests or checks and need repeatable latency, throughput, or cost comparisons.
Skip if: Greenfield features without a correctness gate, purely architectural rewrites without metrics, or one-off micro-optimizations with no measurement plan.
When should I use this skill?
A user asks to make something faster, run recursive optimizations, benchmark latency/throughput/cost, or pick the best implementation by measured tests.
What you get
Baseline metrics, variant benchmark results, and a selected implementation that improves the target metric while passing correctness checks.
- Benchmark comparison results
- Selected optimized implementation
By the numbers
- Tracks five metric types: wall time, p95 latency, rows/sec, cost/run, and memory
- Requires three prerequisites before optimization: operation, correctness gate, and metric
Files
Benchmark Optimization Loop
Use this skill to convert "make it 20x faster" or "try 50 recursive optimizations" into a bounded measured loop that can actually improve a system.
Required Baseline
Do not optimize until these exist:
- the operation being optimized;
- the correctness gate that must stay green;
- the metric: wall time, p95 latency, rows/sec, cost/run, memory, error rate;
- the current baseline;
- the search budget: max variants, max time, max spend, max data impact.
If the user asks for an unrealistic target, keep the ambition but make the loop bounded and measurable.
Loop
1. Measure the baseline. 2. Identify bottlenecks from evidence. 3. Generate variants that test one hypothesis each. 4. Run variants with the same input shape. 5. Reject variants that fail correctness, safety, or reproducibility. 6. Promote the fastest safe variant. 7. Codify the winning path in a script, command, test, config, or doc. 8. Rerun the baseline and winner to confirm the delta.
Variant Table
Track variants like this:
Variant | Hypothesis | Command | Time | Correct? | Notes
baseline | current path | npm run job | 120s | yes | stable
batch-500 | fewer round trips | npm run job -- --batch 500 | 42s | yes | winner
parallel-8 | more workers | npm run job -- --workers 8 | 31s | no | rate limitedRecursive Search
For recursive or hyperparameter work:
- persist every run to a ledger;
- compare against the prior accepted winner, not only the previous run;
- keep a holdout or replay check;
- stop when improvement is within noise, correctness fails, cost exceeds the
budget, or the search starts changing more variables than it can explain.
Use phrases like "best measured safe variant" instead of "global optimum" unless the search space was actually exhaustive.
Promotion Gate
A variant cannot become the new default until:
- correctness tests pass;
- the performance delta is repeated or explained;
- rollback is obvious;
- the change is encoded in source control or a durable runbook;
- the final summary includes exact commands and measurements.
Related skills
How it compares
Pick benchmark-optimization-loop over ad-hoc profiling when stakeholders give open-ended speed goals and you need gated, repeatable variant selection.
FAQ
What must exist before benchmark-optimization-loop starts?
benchmark-optimization-loop requires three baselines: the operation under test, a correctness gate that must remain green, and an explicit metric such as wall time, p95 latency, rows/sec, cost/run, or memory. Optimization does not start without them.
Which metrics does benchmark-optimization-loop track?
benchmark-optimization-loop tracks wall time, p95 latency, rows per second, cost per run, and memory usage. The skill runs repeated measured tests across variants and selects the best passing implementation.