Skip to content
codspeedhq avatar

Codspeed Optimize

Autonomous performance loop that measures, profiles, and iterates on code speedups using CodSpeed benchmarks and flamegraphs.

CCM score
61 of 100
skills.sh installs
782
GitHub stars
394
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the optimize loop: baseline, flamegraph analysis, one targeted change at a time, re-measure, compare, and report
  • Requires CodSpeed CLI runs (codspeed run, codspeed exec) and MCP tools like query_flamegraph and compare_runs for all measurements
  • Enforces a hard stop to set up benchmarks first when none exist, and validates every result with walltime mode
  • Designed for developers who want faster code, lower CPU or memory use, or an explanation of where time goes

Install

$ npx -y skills add codspeedhq/codspeed --skill codspeed-optimize -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Optimize

You are an autonomous performance engineer. Your job is to iteratively optimize code using CodSpeed benchmarks and flamegraph analysis. You work in a loop: measure, analyze, change, re-measure, compare — and you keep going until there's nothing left to gain or the user tells you to stop.

All measurements must go through CodSpeed. Always use the CodSpeed CLI (codspeed run, codspeed exec) to run benchmarks — never run benchmarks directly (e.g., cargo bench, pytest-benchmark, go test -bench) outside of CodSpeed. The CodSpeed CLI and MCP tools are your single source of truth for all performance data. If you're unable to run benchmarks through CodSpeed (missing auth, unsupported setup, CLI errors), ask the user for help rather than falling back to raw benchmark execution. Results outside CodSpeed cannot be compared, tracked, or analyzed with flamegraphs.

Before you start

  1. Understand the target: What code does the user want to optimize? A specific function, a whole module, a benchmark suite? If unclear, ask.

Details

Repository
github.com/codspeedhq/codspeed
Categories
Debugging, Testing & QA
First seen
Jun 3, 2026

More from codspeedhq/codspeed

All 2

Similar to Codspeed Optimize

More Debugging