Claude Code Can Build Evaluations and Improve Apps Against Held-Out Tests
Anthropic's Claude API skill gives Claude Code two evaluation workflows: `/claude-api build-eval` creates an evaluation in a codebase, and `/claude-api hillclimb` proposes one change at a time against it. The hillclimb holds out test cases, reverts changes that do not improve the test set, and reports uncertainty against the baseline.
Anthropic's claude-api skill adds two evaluation workflows for Claude Code: /claude-api build-eval creates an evaluation inside a codebase, and /claude-api hillclimb tries to improve an application against that evaluation one change at a time. Anthropic says the hillclimb workflow uses a held-out set to catch overfitting (Anthropic).
The guide is for developers who already have an application and want to measure a concrete change, such as improving performance or lowering cost while holding performance steady. It does not make a benchmark automatically representative of production. The user still chooses the task distribution, reviews the cases and grader, and decides which code or configuration Claude may change (Anthropic). To test a Claude Code plugin or skill rather than an application, see Claude Code's plugin evals.
Key Takeaways
- Two commands:
/claude-api build-evalbuilds an evaluation inside your codebase, and/claude-api hillclimbimproves your application against it one change at a time. - Update first: the claude-api skill ships inside Claude Code, so running
claude updategets you the latest version of both commands (Anthropic). - You approve the evaluation: build-eval interviews you and pauses for approval at specific points, including the examples and the grader.
- Held-out test set: if the train set improves but the test set is flat, Claude suspects overfitting and reverts the patch.
- Noise check: if the gain is within noise, Claude says so and recommends against merging.
- Anthropic's example: on 14 held-out tickets from a 44-ticket customer support benchmark, the final configuration scored 90.5% against the original setup's 78.6%, at about one fifth of the cost (Anthropic).
Build an Evaluation From Real Work
Running /claude-api build-eval interviews the developer, then helps assemble an evaluation set, grader, runner, and baseline. The skill can draw cases from production transcripts, bug reports, support tickets, examples supplied by the developer, or synthetic cases based on the codebase. It shows the inputs for review and pauses at approval points before running the baseline (Anthropic).
The article's design principle is to mirror important production tasks rather than select cases simply because the current model fails them. Anthropic advises using tasks a domain expert can judge consistently, with the criteria stated clearly enough for the grader to check. The baseline also needs headroom: when the baseline already scores about 95% or higher, the skill warns the developer and steers the hillclimb toward cost or latency rather than quality (Anthropic).
The skill checks whether the grader gives consistent results on repeated runs and watches for infrastructure problems such as timeouts, API errors, or truncated answers. It reports a baseline score with a confidence interval and recommends reading scored transcripts before trusting the evaluator (Anthropic).
Improve One Change at a Time
Running /claude-api hillclimb asks what to optimize and which changes it may make. The allowed surface can include a system prompt, skills or instruction files, tool descriptions, model choice, effort level, API parameters, or harness code. Claude proposes one patch per round and compares the changed application against the evaluation (Anthropic).
To reduce overfitting, the workflow randomly separates the evaluation into training and test cases. Claude can inspect the training cases, but the held-out test set is kept out of its reach. It reverts a patch when training improves but the test score stays flat, and keeps a patch when both sets improve. If the measured gain is within the evaluation's noise, the guide says not to merge it (Anthropic).
What to Check Before Trusting the Result
An evaluation can still diverge from real production traffic. Anthropic warns that a system can overfit to selected examples or exploit details in the harness instead of improving the application for real users. The guide recommends:
- Use cases that matter in production, including concrete failures from traffic, tickets, and bug reports (Anthropic).
- Keep a test set that the optimization loop never sees during tuning (Anthropic).
- The hillclimber may read failing transcripts, but it must never paste the failure content into the prompt it is tuning (Anthropic).
- Make it structurally difficult for the system being evaluated to access the test answers (Anthropic).
- Treat a change as meaningful only when its test-set gain exceeds evaluation noise (Anthropic).
These safeguards make the workflow a way to run controlled experiments in an application codebase, not a guarantee that a model change will generalize. Developers should inspect the cases, grader, and transcripts before acting on a reported gain (Anthropic).
Corrections and Updates
- September 30, 2026: This page said the headroom threshold applied to "a top model" and that failing transcripts must not be pasted "into prompts used by the hillclimber". Anthropic's post ties the threshold to the baseline run of the developer's own configuration, and says the hillclimber may read failing transcripts but must never paste the failure content into the prompt it is tuning. Both sentences are corrected above.
Sources
- Anthropic, “Automating eval design and hillclimbing with Claude,” September 28, 2026: https://claude.dev/blog/automating-eval-design-and-hillclimbing/
Read next
Related coverage- Claude Code
Claude Code Adds Plugin Evals for Regression Testing and No-Plugin Baselines
Claude Code now includes `claude plugin eval`, a testing workflow for plugin and skill authors. The command can create cases and graders, run a plugin in isolated non-interactive sessions, compare results with a no-plugin baseline, generate an HTML report, and support CI gates for plugin changes. Evals require Claude Code v2.1.269 or later and consume model usage.
- Claude
Claude Sonnet 5.5 Launches With Lower Task Costs and Cursor Support
Anthropic introduced Claude Sonnet 5.5 on September 28 with model ID `claude-sonnet-5-5`. It keeps Sonnet 5's $2 input and $10 output price per million tokens; Anthropic reports output generation more than 30% faster and up to 30% lower cost per task. Cursor lists the model in Settings > Models. Cache reads dropped to $0.10 per million tokens on October 7.
- Claude Code
Claude Code Projects Turn One Conversation Into Parallel Cloud Sessions
Anthropic's redesigned Projects beta gives Claude Code one coordinating conversation that delegates work to parallel threads. Threads are usually cloud sessions, which Anthropic's docs now list as available, no longer in research preview, on Pro, Max, and Team and for eligible Enterprise seats. A project can also run a thread on your own machine through Remote Control.
Frequently Asked Questions
What do /claude-api build-eval and /claude-api hillclimb do?
/claude-api build-eval interviews you and builds an evaluation inside your codebase: cases, a grader, a runner, and a baseline score with a confidence interval. /claude-api hillclimb then improves your application against that evaluation one change at a time, with a held-out set of examples to catch overfitting.
How do I get the build-eval and hillclimb commands?
Run claude update first. Anthropic says the claude-api skill ships inside Claude Code, so updating gets you the latest version of both commands. Then run /claude-api build-eval to create an evaluation, or /claude-api hillclimb when you already have one and want Claude to improve against it.
How does the hillclimb avoid overfitting?
It splits the evaluation into training and test cases, and Claude reads only the training transcripts. If the train set improves but the test set is flat, Claude suspects overfitting and reverts the patch; it also reverts a regression. It keeps a patch only when train and test sets improve.
When should I not trust a hillclimb result?
When the gain is within the evaluation's noise: Claude says so and recommends against merging. Also check that the cases reflect real production work, that the grader scores correctly, and that the system under test cannot reach the test answers, because an evaluation can still diverge from production traffic.