# Improvement loop

> A software factory improves when it keeps its traces, grades them and tests configuration changes on real work. Scorers, replay, internal benchmarks and continuous evaluation are the tools.

Everything starts with traces. Each run keeps its full timeline: messages, tool calls, MCP access, artifacts, handoffs between agents and subagents. Traces help you debug a failed run and improve the factory.

Scorers grade finished runs, using a judge model or people, on things a test cannot check: architecture quality, redundant tests, efficient tool use. If many runs fail the redundant-tests scorer, an agent can spot the trend and propose a change to a skill.

Replay reruns real work from the exact state of the repository, with a different configuration. An internal benchmark uses this to compare models or settings and plot each one on a cost and quality curve. It tells you more than a public leaderboard such as SWE-bench, because it runs on your tasks. The best setting then ships like code.

Continuous evaluation replays 20 to 50 real tasks in CI whenever instructions, skills or hooks change. Every production incident becomes a new case, and the suite is refreshed as models improve. It works like an experiment: one hypothesis, one variable changed, then a comparison.

An agent missing a tool can work around it, rebuild it or hand-write what the tool would have generated. It then finishes its task with a green result and no warning. Two things catch this: an agent that reads traces every week and a judge model that flags unusual runs. The judge needs checking too: rerun each pair with the answers swapped, and be wary of models from the same family, which agree with each other more.

**When**: Before switching models, when the API bill climbs or to understand a failed run.

**Trade-offs**: You need a rich history and a budget for replays. The gain then has to be confirmed in production. Traces grow fast and contain sensitive information, so set a retention period and read permissions.

## Where to start

- Keep every run trace
- Build a first scorer for a common defect
- Assemble a suite of 20 to 50 real tasks
- Change one variable, replay, compare
- Open metrics to agents through an API or MCP

## Common mistakes

- Changing several settings at once
- Relying on public benchmarks alone
- Letting the evaluation suite go stale
- Applying a self-improvement suggestion before replaying it on the evaluation suite
- Trusting a green result without reading the traces

## Metrics

- Evaluation pass rate over time
- Average score per scorer
- Time from an incident to its entry in the evaluation suite

## Sources

- [Warp, The Factory Stack](https://www.warp.dev/blog/the-factory-stack)
- [Warp, Becoming a factory engineer](https://www.warp.dev/blog/factory-engineering-software-factories)
- [Warp, 7 core components for building a software factory](https://www.warp.dev/blog/7-ways-to-build-a-software-factory)
- [Anthropic, The AI-native SDLC playbook](https://claude.com/fr/resources/articles/the-ai-native-sdlc-playbook)
- [Andrew Eacott, How do you know it’s any good? (Miro)](https://www.adventuresintech.org/what-it-takes-to-build-a-software-factory-part-3-how-do-you-know-its-any-good/)
