By Sagar Shankaran, Founder of CallSphere
Build a Claude agent eval loop: outcome and trajectory metrics, real-failure datasets, rubric-driven LLM-as-judge, and CI gates that block regressions.
Key takeaways
You cannot ship an agent you cannot measure. Unlike a deterministic service, an agent's behavior drifts with every prompt edit, tool change, and model upgrade, and a tweak that fixes one case quietly breaks three others. Vibes-based iteration works until it doesn't — usually in production. The fix is an eval loop: a repeatable harness that scores your agent against a fixed dataset and blocks releases that regress. This post is about building that loop for Claude agents, from choosing what to measure to wiring an LLM-as-judge you can actually trust.
Agent quality is multidimensional, and picking the wrong metric leads you astray. There are three families worth tracking. Outcome correctness asks whether the final state is right: was the ticket actually created, the answer factually correct, the refund the right amount? Trajectory quality asks whether the path was reasonable: did the agent pick the right tools, avoid loops, and not take destructive detours? Operational metrics cover cost and latency: tokens per run, turns per run, and wall-clock time.
A clean definition to anchor on: an agent eval is an automated test that runs the agent on a fixed input and scores its output and behavior against predefined success criteria. The word "fixed" is doing real work — without a frozen dataset, you cannot compare runs, and comparison is the entire point.
Start small and real. Twenty to fifty hand-picked cases beat a thousand synthetic ones, because each should encode a specific behavior you care about. Seed the set from three sources: golden-path cases that must always work, edge cases you know are tricky, and — most valuably — real production failures. Make it a rule that every bug you fix gets a corresponding eval case added before the fix merges. Over a few months this dataset becomes your most valuable asset: a precise, growing specification of what "good" means for your agent.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
flowchart TD
A["Code / prompt change"] --> B["Run agent on fixed eval set"]
B --> C["Score outcome + trajectory"]
C --> D{"LLM-as-judge for fuzzy cases"}
D --> E{"Pass rate >= threshold?"}
E -->|Yes| F["Allow merge / release"]
E -->|No| G["Block & surface failing cases"]
G --> A
Each case is just structured data: an input, the success criteria, and any required final-state assertions. Keep it in version control next to the code so the dataset evolves with the agent.
{
"id": "refund-wrong-item-001",
"input": "I got the blue mug but ordered the red one, order ORD-10024829",
"expect": {
"final_tool": "refund_order",
"args": { "order_id": "ORD-10024829", "reason": "wrong_item" },
"max_turns": 6,
"must_not_call": ["delete_order"]
}
}
Prefer code-based checks wherever the criterion is objective. Did the agent call refund_order with the right ID? Assert it directly. Did it stay under the turn cap and avoid the forbidden tool? Assert those too. Deterministic checks are fast, free, and unambiguous, so use them for everything you can express as a rule.
For criteria that resist hard rules — was the tone appropriate, was the explanation accurate and complete — use a Claude model as a judge. The trick is to make the judge as deterministic as possible: give it a specific rubric, ask for a structured verdict with a short justification, and run it at low temperature. A vague "rate this 1-10" judge is noise; a rubric-driven "does the response satisfy each of these three named criteria, true or false" judge is signal.
You are grading a support agent's reply. Score each criterion true/false:
1. factual: every claim matches the provided order data
2. resolved: the reply states a concrete next step
3. tone: professional, no blame toward the customer
Return JSON: { "factual": bool, "resolved": bool, "tone": bool, "why": "one sentence" }
An LLM judge is itself a model that can be wrong, so validate it before you depend on it. Hand-label a sample of fifty cases, run the judge on the same cases, and measure agreement. If the judge agrees with your human labels most of the time, you can trust it for the rest; if it disagrees often, fix the rubric until it does. Re-validate whenever you change the judge prompt or the judge model. A judge you have never checked against human labels is just a confident guess.
An eval loop only changes behavior if it blocks bad releases. Run the suite on every pull request that touches the prompt, the tools, or the model version, and fail the build if the pass rate drops below your threshold. Evals can be token-hungry, so keep them affordable: share one stable system-plus-tools prefix across all cases and cache it, so each case pays full price only for its unique tail. Run independent cases through the batch path for an extra discount when CI latency allows. Report the delta against the previous run so reviewers see exactly which cases regressed.
| Criterion type | Scoring method | Example |
|---|---|---|
| Objective final state | Code assertion | Correct tool called with correct ID |
| Behavioral constraint | Code assertion | Stayed under turn cap, avoided forbidden tool |
| Subjective quality | Rubric LLM-as-judge | Tone, accuracy, completeness |
| Cost / latency | Usage metrics | Tokens and turns per run |
Far fewer than you think — 20 to 50 well-chosen cases that each encode a real behavior beat thousands of synthetic ones. Grow the set by adding a case for every production failure, so the suite becomes a precise, lived-in specification of correct behavior over time.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
Only after you validate it. Pin the judge with a named-criteria rubric and low temperature, then measure its agreement against a sample of human labels. If agreement is high, use it; if not, refine the rubric and re-check whenever you change the judge prompt or model.
Share one stable system-plus-tools prefix across every case and cache it, so each case only pays full price for its unique input tail. Route independent cases through the batch path when CI can tolerate the latency, and watch cache-read tokens to confirm the savings.
A drop in pass rate below your defined threshold, especially on golden-path or trajectory checks. Treat a regression on a previously passing case as a hard stop — the whole point of the loop is that quality can only move forward, never silently backward.
CallSphere gates its voice and chat agents the same way — fixed eval sets, rubric-driven judges, and CI thresholds — so every release of a call-handling agent is measured before it talks to a customer. See it live at callsphere.ai.
Source & attribution: This is an independent, original explainer inspired by Anthropic's coverage on the Claude blog. Claude, Claude Code, Claude Cowork, Claude Opus, and the Model Context Protocol are products and trademarks of Anthropic. CallSphere is not affiliated with or endorsed by Anthropic.

Written by
Sagar Shankaran· Founder, CallSphere
LinkedInSagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
Anthropic's Claude Fable 5 and Mythos 5 explained: pricing, availability, frontier benchmarks, the dual-model safeguard architecture, and what they mean for AI agents.
Where Claude Code, MCP, and multi-agent systems are taking GTM engineering next, and how to prepare your team now for standing and multi-agent workflows.
Where Claude Cowork and the Claude agent ecosystem are heading next — standing agents, MCP, skills as a moat — and the concrete moves to prepare your team now.
The metrics, leading signals, and anti-metrics that prove Claude Cowork is working — acceptance rate, time-to-outcome, and why usage counts mislead.
Shipping an agentic GTM workflow is easy; proving it works is hard. The metrics, signals, and eval loops that show a Claude Code rebuild is paying off.
A realistic end-to-end Claude Cowork use case: a quarterly vendor-spend review from vague ask to shipped deliverable, with every agentic step shown.
© 2026 CallSphere Inc. All rights reserved.
Made within San Francisco
Watch how CallSphere handles real customer calls, schedules appointments, and processes payments — live.
Try Live DemoBook a DemoCalculate Your ROI