Skip to content

Measured Optimization Loop

Runs a measured loop that cost-profiles a workload or tests variants and keeps only scored winners on a branch.

Stars
25,850
Licence
MIT
Files
15 files

What it does

When installed, the agent can take a named system or piece of code with a measurable metric (such as cost, speed, or a quality score) and run a controlled loop: it sets up a measurement harness, records a baseline, forms hypotheses, tries changes in isolated experiments, and keeps only the changes that score better, committing them to an optimize/<spec-name> git branch with a written log. It stops at approval gates so you can confirm the plan and spend before experiments run.

Great for

  • Developers who want evidence-based speedups or cost reductions for an existing workload
  • Teams comparing prompt or implementation variants against a scored benchmark
  • People who want a written, reproducible log of every experiment and its result

Skip it if

  • Diagnosing a bug or root cause; the skill itself says to use ce-debug for that instead
  • Changes you already know you want; ce-work is the better fit (the skill's own guidance)
  • Runs with uncapped spend or sensitive repos where automatic commits and experiments are unwanted, since it creates branches and keep/revert commits after you approve

Try asking

  • “Optimize the token cost of our summarization workload using the spec at specs/summarize.yaml”
  • “Compare five variants of this prompt against our judge rubric and keep the best one”
  • “Describe the optimization goal for our API latency and let the loop set up the benchmark first”
Step-by-step guide: how to use Measured Optimization LoopInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 15 original files, the MIT licence and an attribution note.

    ce-optimize.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip ce-optimize.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip ce-optimize.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Start with a spec YAML that sets explicit spend caps and scope.mutable files so experiments stay bounded.
  • Review the Phase 1 approval summary carefully before approving; experiments start only after you say yes.
  • Keep the target repo's changes committed first, since the skill refuses to proceed with uncommitted changes in scoped files.

What's inside

  • references/agents/learnings-researcher.md
  • references/agents/repo-research-analyst.md
  • references/example-expensive-benchmark-spec.yaml
  • references/example-hard-spec.yaml
  • references/example-judge-spec.yaml
  • references/example-text-target-spec.yaml
  • references/experiment-log-schema.yaml
  • references/experiment-prompt-template.md
  • references/judge-prompt-template.md
  • references/loop.md
  • references/measurement.md
  • references/optimize-spec-schema.yaml
  • references/persistence.md
  • references/spec.md
  • SKILL.md

Redistributed unmodified from EveryInc/compound-engineering-plugin under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.