
Codspeed Optimize
This is an autonomous performance optimization loop that uses CodSpeed benchmarks and flamegraph analysis to make code faster without you babysitting it. It runs benchmarks, digs into flamegraphs to find bottlenecks by self-time, applies targeted fixes one at a time, re-measures, and keeps going until the gains dry up. It's strict about methodology: always measure through CodSpeed, never change multiple things at once, validate improvements in walltime mode before calling it done. The workflow is solid if you already have benchmarks set up, but it won't optimize blindly. If you don't have a harness yet, it stops and tells you to set one up first, which is the right call.
- skills.sh installs
- 463
- GitHub stars
- 392
- last updated
- Aug 21, 2026
Install
$ npx -y skills add codspeedhq/codspeed --skill codspeed-optimize --agent claude-codeInstalls into .claude/skills of the current project.
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
- Understand the target: What code does the user want to optimize? A specific function, a whole module, a benchmark suite? If unclear, ask.
Sponsors
Details
- Repository
- github.com/codspeedhq/codspeed
- Category
- Debugging
- First seen
- Jun 3, 2026