CLAUDE LABJP
FORK — Claude Code 2.1.212 changes what /fork does: it copies your conversation into a new background session with its own row in claude agents, so you can keep working. The old in-session subagent is now /subtaskLIMITS — WebSearch calls are now capped at 200 per session by default, and subagent spawns get the same 200 ceiling, so a runaway search or delegation loop stops on its ownMCPBG — MCP tool calls running past two minutes now move to the background automatically, keeping the session usable. Tune the threshold with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSPLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callbackSONNET5 — Claude Sonnet 5 is running on introductory pricing of $2 per million input tokens and $10 per million output. After August 31 it moves to $3 and $15IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as OctoberFORK — Claude Code 2.1.212 changes what /fork does: it copies your conversation into a new background session with its own row in claude agents, so you can keep working. The old in-session subagent is now /subtaskLIMITS — WebSearch calls are now capped at 200 per session by default, and subagent spawns get the same 200 ceiling, so a runaway search or delegation loop stops on its ownMCPBG — MCP tool calls running past two minutes now move to the background automatically, keeping the session usable. Tune the threshold with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSPLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callbackSONNET5 — Claude Sonnet 5 is running on introductory pricing of $2 per million input tokens and $10 per million output. After August 31 it moves to $3 and $15IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as October
Articles/API & SDK
API & SDK/2026-05-30Advanced

Catching Claude Quality Regressions With an Eval Harness

I tweaked a prompt by one line and, for a different set of inputs, the output quietly got worse. Here is the eval harness I built to protect Claude's production quality across every prompt change and model update, with full implementation code and real operating numbers.

Claude46evalqualityLLM-as-judgeAPI27

Premium Article

I tweaked a prompt, and something else quietly broke

I once changed a classification prompt by a single line — "let's have it classify a little more carefully" — and shipped it. The handful of inputs I tried locally were clearly better. A few days later a report came in: one specific category had gotten worse. The inputs I had checked improved; the inputs I hadn't checked quietly degraded.

I've been building apps on my own since 2014, reaching somewhere around 50 million downloads over the years. With code, tests guard against a change breaking existing behavior. But in a feature built on Claude, the same prompt produces different output depending on the input, so traditional assertion-style tests don't carry over as-is. "Tried a few, looks good, ship it" was a bet placed after seeing only a sliver of the input distribution.

So I built an eval harness that mechanically detects quality regressions every time I change a prompt or a model. My grandfather, a temple carpenter, taught me that working with your hands is a kind of devotion — and an eval foundation is exactly the kind of quiet, hands-on groundwork that pays off later. Here is the implementation, and the numbers I saw running it.

Why you need evals, not unit tests

Claude's output is not deterministic. Even at temperature 0, slightly different input yields different output, and even a minor model update shifts behavior. What you want to protect is not "a specific string for a specific input" but "a quality level across the whole input distribution."

That is the decisive difference from conventional testing. A unit test pins down a single point; an eval measures a distribution. The metrics worth guarding boil down to two: first, the average quality score over a representative set of inputs; second, its spread — especially the deterioration of the lowest-scoring band. The opening incident would have slipped past a pure average. Degradation on a subset like one category only surfaces when you look at stratified scores.

Building a golden dataset, minimally

The foundation of an eval is a golden dataset. You don't need perfect expected outputs. It's far more practical to attach a "pass condition" — a rubric — to each input. I made just 40 cases in the first week, then added one each time an incident or complaint appeared, growing it to 200 over six months.

# golden.jsonl — one case per line. "expected" is a rubric, not a string match.
# {"id": "cat-012", "category": "refund", "input": "...", "rubric": ["classified as refund", "states a one-sentence reason", "no PII in output"]}
 
import json
from pathlib import Path
 
def load_golden(path: str) -> list[dict]:
    cases = []
    for line in Path(path).read_text(encoding="utf-8").splitlines():
        line = line.strip()
        if line:
            cases.append(json.loads(line))
    return cases

The key is to break each rubric into items you can judge objectively as YES/NO. Vague criteria like "should be polite" produce wobbly judgments. Driving items down to a grain where humans wouldn't disagree — "states a reason in one sentence," "uses no category name outside the allowed list" — was the single biggest lever for the judge-agreement rate below.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A complete eval harness that catches quietly-degraded output from prompt or model changes before you push
Rubric design that tamed LLM-as-judge drift and lifted agreement with human grading from 68% to 91%
How to set regression thresholds for CI, plus the real per-run cost of my 200-case golden set
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API & SDK2026-07-14
A Two-Stage Pre-Publish Gate for User-Facing AI Text in Consumer Apps
Design a two-stage pre-publish gate for short AI-generated text you ship to end users: a deterministic rule layer plus a Claude classifier, with fail-closed handling, generation-time vetting, and a cost model. Full implementation code included.
API & SDK2026-07-12
A Long Non-Streaming Response Was Billed Twice Past the 10-Minute Wall: Redesigning the SDK's Default Timeout and Retries
The Anthropic SDK's default 10-minute timeout and two automatic retries can silently re-run a long non-streaming response and bill you twice. Here is how the trap works, and how to close it with streaming, explicit timeout/max_retries, and a small local ledger — with measured before/after numbers.
API & SDK2026-06-22
Drop Your Static Claude API Keys: Moving CI and Production to Keyless Auth with Workload Identity Federation
Workload Identity Federation is now generally available on the Claude Platform. This guide walks through replacing long-lived sk-ant- keys with short-lived OIDC tokens, including keyless GitHub Actions auth, the migration steps, and token refresh design.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →