Subscribe to Newsletter

Module 4: Measure and Improve the Factory

You already track the share of tasks your factory ships automatically, and what they cost. This module adds the measures that tell you how to improve the factory, and a loop that improves it for you.

Start module Module 4 of 5 · 4 lessons

4.1

Measure what your factory ships

The number of features an engineer ships is a failure metric. Judge the factory by its efficiency instead:

FACTORY EFFICIENCY Shipped product Inference cost + Human time cost Software production moves from an R&D expense to COGS.
Scroll sideways →Source: Warp, We are now factory engineers.

Count human touches per PR

Track human touches per PR, and push the number down over time. Here is how the touches add up on a relatively complex feature, such as search, sort and filter for a database-driven view:

HUMAN FACTORY Prompt + mocks 1 TOUCH Spec iterations N TOUCHES Implements the feature Adversarial code review Computer-use videos Final look, maybe review 1 TOUCH
Scroll sideways →Source: Warp, Adapting for a world of software factories.

For the outside view, track the standard DORA metrics: PR merge rate, cycle time, defect rate and time to fix errors. If they all improve as agent use grows, your agents deliver value.

TRY THIS TODAY · COUNT THE TOUCHES ON ONE FEATURE
  1. Pick one feature your team shipped recently.
  2. Count every human touch, from the first prompt to the merge.
  3. Note which touches the factory could take over next.
4.2

Build a small eval suite from real failures

Without evals, you debug reactively: you wait for complaints, reproduce by hand and hope nothing else regressed. Teams with evals also adopt new models in days, while teams without them face weeks of tests, according to Anthropic's engineers.

Start with 20 to 50 tasks

Draw 20 to 50 simple tasks from real failures in your bug tracker and support queue. For coding agents, unit tests check correctness and an LLM rubric assesses code quality. Use deterministic graders where you can, and LLM graders only where you must.

Agent output varies between runs, so run several trials of each task. One pass tells you little. At a 75% success rate per trial, the chance that all three trials pass is (0.75)³, or about 42%. Measure that consistency for agents that users expect to work every time.

Split capability evals from regression evals

Capability evals ask what the agent can do well. They start at a low pass rate and give you a hill to climb. Regression evals check that the agent still handles everything it used to, and they should pass nearly every time:

Capability evals What can the agent do well? Starts at a low pass rate: a hill to climb. Regression evals Does it still handle what it used to? Nearly 100%; a drop means something broke. graduates once it passes consistently low pass rate (schematic) ~100% pass rate
Scroll sideways →Source: Anthropic, Demystifying evals for AI agents.

Keep the suite trustworthy

  • Write unambiguous tasks. Two domain experts should independently reach the same verdict, and each task needs a reference solution that passes.
  • Isolate every trial. Start each one from a clean environment, because shared state can inflate scores.
  • Grade the outcome, not the path. Agents find valid approaches that eval designers didn't anticipate.
  • Name owners. Let the people closest to the product and its users add tasks.
4.3

Score agent sessions with an LLM judge

Agents leave a complete record of their work, so you can grade past sessions with an LLM as the judge. Set it up in four steps:

SCORE PAST SESSIONS Agent traces inputs + output artifacts, via API Sampler a % of runs or a classifier rule Scoring agents one dimension each, on a cron schedule Scores trends, regressions, failures to open prompt · classifications · judge model
Scroll sideways →Source: Warp, Using LLM-as-a-judge scoring.
  1. Store complete traces behind an API: every prompt, tool call and MCP result, plus every PR, spec and screenshot the agent created.
  2. Define scoring agents. Each one grades a single dimension with a prompt, classification instructions and a judge model.
  3. Sample runs by percentage, or by a rule such as "score all my front-end tasks." In Warp's own factory, scoring takes about 3% of total token costs.
  4. Schedule the scorers with a cron-based cloud agent.

What to score

DimensionThe question it asks
Task complianceDid the agent complete the task as the user asked?
EfficiencyDid it complete the task efficiently, or do a lot of unnecessary work?
VerbosityDid it emit the right number of tokens for the task?
QualityWas the code good, and did it match expected conventions?
CustomDid it use the right internal MCPs and Skills?

Worked example: a scorer for redundant tests

Redundant tests were a common failure in Warp's factory, so the team built a scorer for them. The scorer has three parts:

  • A judging prompt: a rubric for what counts as a redundant test.
  • Output classifications: the results that count as a pass.
  • A sampling rate: the percentage of runs to score.

When it runs, the scorer loads an agent trace, brings all its inputs and outputs into context, and prompts an LLM to judge the run. The pass rate showed that agents mostly avoided redundant tests, with a few failing runs each day.

Open failures like these, and check what the coding agent did. Check the scorer's own run too, since the scorer is just another agent. Look for patterns, then adjust your skills so agents write tests more sparingly.

Keep your judges honest

  • Calibrate against humans. Compare the judge with human experts until little divergence remains.
  • Give the judge a way out. Tell it to return "Unknown" when it lacks enough information.
  • Read the transcripts. Grading bugs can produce low scores even when the agent performs well:
CORE-BENCH · ONE MODEL'S SCORE Before fixes 42% After fixes 95%
Scroll sideways →Source: Anthropic, Demystifying evals for AI agents.

The Code: Your daily unfair advantage in software engineering.

Join 350,000+ software engineers, tech leads, and CTOs who start their morning with The Code.

Subscribe to Newsletter
4.4

Build a self-improvement loop

You can automate the outer loop with agents too. Ben Holmes, a software developer at Warp, runs one on his team's factory to improve agent skills. The team has merged quite a few skill changes from it. For more patterns, see our loop engineering guide.

OUTER LOOP · SELF-IMPROVEMENT INNER LOOP agents build the product 1 · Score agents score each conversation 2 · Find on a schedule, an agent finds low scores 3 · Propose it opens a skills PR that cites evidence 4 · Check a human merges; scores show if it helped
Scroll sideways →Sources: Ben Holmes on X; Warp, Using LLM-as-a-judge scoring.

Feed the loop more than scores

  • Every human intervention. Record it, and have self-improvement agents change the flow so a human is less likely to step in again.
  • Token waste. Run agents over factory conversations to find patterns of waste and suggest efficiency gains.
  • Harnesses and prompts. Eval them, and note which work best for the next run.

Point outer-loop agents at code architecture too, and have them add static analysis checks. These checks are even better guardrails than skills, because they stop bad code before it spreads. Before you roll out a new model configuration, benchmark it against your scorers.

Read on X: Lauren (@poteto), works on Grok at SpaceXAI.
TRY THIS TODAY · RUN SKILL DOCTOR ON YOUR SESSIONS

Goal: See which skill changes your past agent conversations point to.

  1. Get the open-source Skill Doctor skill that Ben Holmes published, and add it to your coding agent.
  2. Run /skill-doctor on your recent agent conversations.
  3. Read the scores for efficiency, code quality and skill coverage.
  4. Pick one suggested skill edit, merge it, and run the skill again after a few sessions.

Expected result: One skill change backed by evidence from your own sessions, plus a score that shows whether it helped.

END OF MODULE 4

By this point you should have:

  • Factory efficiency, human touches per PR and DORA metrics on your dashboard.
  • A small eval suite built from real failures.
  • LLM judges that score your agents' sessions, and checks that keep them honest.
  • A self-improvement loop that turns low scores into skill changes.