Developer & Code
Verify code optimizations with controlled experiments
Use a coding-agent skill to test small performance changes against explicit benchmarks and correctness requirements.
When to use this
Apply this workflow when optimizing slow software and you need evidence that each retained change improves performance without altering required behavior.
What you’ll need
- Claude Code with permission to install plugins
- A codebase tracked in Git
- Representative benchmark inputs
- Correctness tests with clearly defined acceptance criteria
- A time or experiment budget
1. Enable the optimization skill
Install the skill using `/plugin install aae --marketplace CHSZLab/AgenticAlgorithmEngineering`. Start it with `/aae:aae` and describe the code you want to optimize.
2. Set the experimental boundaries
Agree on a representative benchmark, the performance metric, and the available budget before making edits. Specify which outputs or behaviors must remain unchanged and how the agent will verify them.
3. Establish a baseline and prediction
Measure the existing implementation under repeatable conditions and inspect profiling data. Ask the agent to propose one testable explanation for the bottleneck and estimate the improvement a targeted change could produce.
Starter request
Investigate the performance of [task or code] using [representative input]. Work within [experiment or time budget] and preserve [required behavior]. Suggest a single targeted modification, explain the suspected bottleneck, and estimate its likely effect. Define reproducible baseline and candidate measurements plus a test for correctness. Report an improvement only after executing the checks and comparing the results.
4. Make one isolated change
Have the agent implement a small modification and record it in Git. Run the correctness checks before treating the candidate as a valid optimization.
5. Measure and decide
Run the same benchmark on the modified implementation and compare it with the baseline. Retain the patch only when it passes the required checks and demonstrates a performance gain; otherwise revert it.
6. Repeat within the budget
Continue with a new hypothesis and one isolated modification per experiment. Stop when the agreed budget is exhausted and summarize the measured results of the retained patches.
AI-generated results need independent checking before use.