Skip to content

Guide · Agent skill

How to use the Measured Optimization Loop agent skill (ce-optimize)

Updated · written with AI from the project's own documentation and checked against our catalogue data

ce-optimize is an agent skill, a SKILL.md instruction package that a coding agent loads to follow a specific procedure. It is for developers who want to improve a measurable metric, such as cost, speed, or a quality score, on a system that already works, without already knowing which change will help. After this guide you will know how to install the skill, how to ask for it in plain language, what it does at each stage, and what to check before approving a run.

Measured Optimization LoopEveryInc/compound-engineering-plugin · MIT

Quick start

  1. 1Download the ZIP. Download the ce-optimize skill ZIP from this page.
  2. 2Unzip into a skills folder. Unzip into ~/.claude/skills/ for personal use, or into .claude/skills/ inside your project.
  3. 3Prepare the repository. Make sure the repository is a git checkout and the files you want optimized have no uncommitted changes.
  4. 4Make a benchmark or judge. Define the scripts your optimization spec uses to score results.
  5. 5Ask for the optimization. Describe the target system and the metric in a natural request, or pass a spec YAML path.
  6. 6Approve the plan. Review the measurement setup, baseline, caps, and scope, then explicitly approve before experiments run.
  7. 7Review the results. Check the optimize/<spec-name> branch and the written log for kept changes and their scores.

What the skill makes the agent do

When installed, the agent takes a named system or piece of code with a measurable metric and runs 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.

Winning changes are committed to an optimize/<spec-name> git branch with a written log. The run stops at approval gates so you can confirm the plan and spend before experiments run.

  • Attributes the cost of a named workload before searching implementations, when that is the cheapest useful first step.
  • Scores variants against a benchmark or judge and keeps the winners.
  • Writes a disk log of every experiment and its result.

Install the ce-optimize skill

Download the ZIP for this skill from this page. Unzip it into one of two places: ~/.claude/skills/ for your personal use across projects, or .claude/skills/ inside a specific project if only that project should have it.

If you use the Claude apps instead, upload the skill under Settings → Capabilities → Skills.

  • Personal install: unzip into ~/.claude/skills/
  • Project install: unzip into .claude/skills/ in the project root
  • Claude apps: Settings → Capabilities → Skills, then upload

Trigger the skill with a natural request

You do not need a special command. Describe the goal and the metric in plain words. The skill's description says to use it when a working system's metric should move and the winning change is not already known.

You can also pass a path to an optimization spec YAML file, or describe the goal directly. Use a different skill when the job is different: ce-debug for diagnosing a bug or root cause, and ce-work when you already know the change you want.

  • Example: "Use ce-optimize to cut the cost of our summarization workload without lowering the judge score."
  • Example: "Run the measured optimization loop on the search indexing function and tell me which variants beat the baseline."
  • Example with a spec: "Use ce-optimize with optimize-spec.yaml."

Understand the phases and approval gates

The skill runs four phases in order: setup, measurement scaffolding, hypothesis generation, and the optimization loop, followed by wrap-up. Before any experiment runs, the agent must check that files in the mutable and immutable scope have no uncommitted changes, and it must present the plan for your approval.

The run stops automatically on any of eight criteria, including every required target being met, max iterations, max active hours, a spend cap, plateau, a user interrupt, or no runnable hypothesis left.

  • Clean-tree gate: no uncommitted changes in scoped files.
  • User approval gate: you must explicitly approve before experiments start.
  • Dependency pre-approval: new dependencies are listed in one bulk list for your approval.

Know what you need before you start

The repository must be a git checkout, and the files in scope need a clean tree. The host agent must support SKILL.md skills. You also need benchmark or judge scripts defined by your optimization spec.

The example specs use LLM-based judging, which may need model API access and keys. The files do not specify which keys are needed, so check your spec before running.

  • git repository with a clean tree for scoped files
  • An agent host that supports SKILL.md skills
  • Benchmark or judge scripts from your optimization spec
  • Model API access and keys if your spec uses LLM judging

Safety notes before you approve a run

This skill runs scripts and uses the network. It creates branches and keep/revert commits on optimize/<spec-name> after you approve. Review the spec, caps, and scope before approving.

Avoid running it with uncapped spend, or on sensitive repositories where automatic commits and experiments are unwanted.

  • Set spend caps so the run has limits; the skill states caps are limits, not forecasts.
  • Read the spec's mutable and immutable scope before approving.
  • Read the Phase 1 gate summary, which discloses capped and uncapped spend.

Tips for better results

Write a clear metric and a benchmark that matches it. The loop can only keep changes that score better on what you measure. Keep the log: it is the record of every experiment, and it is the source of truth for resuming a run.

  • Name the metric and how it is measured in your request.
  • Keep the working tree clean before starting.
  • Use a spec YAML file for repeatable runs.

What people use it for

  • Cutting the per-run cost of an LLM workload while holding a quality score steady.
  • Comparing prompt variants against a scored benchmark and keeping the best one.
  • Finding speedups in an existing function by testing implementation variants against a timing benchmark.
  • Producing a reproducible written log of every experiment for a team review.

Frequently asked questions

How do I install the ce-optimize skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into .claude/skills/ in a project. In the Claude apps, upload it under Settings → Capabilities → Skills.

What does ce-optimize require?

It requires a git repository with a clean tree for the files in scope, and a host agent that supports SKILL.md skills. You also need benchmark or judge scripts from your optimization spec, and model API access and keys if the spec uses LLM judging.

Is ce-optimize free?

The source material does not state pricing or licence terms beyond the licence listed for the repository, which is MIT. Any model API costs for LLM judging are separate and depend on your provider.

When should I use ce-optimize instead of ce-debug or ce-work?

Use ce-optimize when a metric should move and the winning change is not known. The skill says to use ce-debug when the job is diagnosis, and ce-work when the change is already known.

Does ce-optimize make commits to my repository?

Yes, after you approve the plan. It commits kept changes and keep/revert commits to an optimize/<spec-name> git branch and writes a log of each experiment.

Why did the run stop before running experiments?

The skill has gates. It stops if files in scope have uncommitted changes, and it waits for your explicit approval before Phase 2. Resolve the reported issue and approve again.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use ce-optimize if you have a working system with a measurable metric, want evidence-based speedups or cost cuts, and are comfortable with the skill creating branches and commits after you approve. Pick ce-debug if you are chasing a bug's root cause, or ce-work if you already know the change you want, since this loop is heavier than either.

Download the skill