codspeedhq avatar

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-code

Installs 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

  1. 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

More from codspeedhq/codspeed

All 2

Recommended

More Debugging
1jwynia avatarendingsjwynia/agent-skillsDiagnose weak endings, rushed resolutions, and arbitrary conclusions. Use when stories build well but end disappointingly, when climax feels unearned, or when r461skills.sh installs
2ejirocodes avatarnestjs-best-practicesejirocodes/agent-skillsNestJS 11+ best practices for enterprise Node.js applications with TypeScript. Use when writing, reviewing, or refactoring NestJS controllers, services, modules460skills.sh installs
3martinholovsky avatarcelery-expertmartinholovsky/claude-skills-generatorExpert Celery distributed task queue engineer specializing in async task processing, workflow orchestration, broker configuration (Redis/RabbitMQ), Celery Beat 458skills.sh installs
4davila7 avatarcode-reviewdavila7/claude-code-templatesPerform code reviews following Sentry engineering practices. Use when reviewing pull requests, examining code changes, or providing feedback on code quality. Co457skills.sh installs
5easysoft avatarzentao-toureasysoft/zentao-skills以轻松聊天的方式带用户上手禅道(ZenTao)与 zentao-cli,让用户顺着自己的角色(产品经理/项目经理/测试/开发/高管)在真实禅道环境里边聊边动手,熟悉产品、需求、计划、任务、Bug、测试用例等模块的增删改查与状态流转。当用户首次接触禅道、想上手 zentao-cli、希望了解禅道能做什么,或明确提出"带我456skills.sh installs
6secondsky avatarinteraction-designsecondsky/claude-skillsCreates intuitive user experiences through feedback patterns, microinteractions, and accessible interaction design. Use when designing loading states, error han456skills.sh installs