/prompt-evaluation-claude-code:capture-eval-case [agent-name | eval-set path | what was wrong]from prompt-evaluation-claude-code
Capture an agent's wrong, stale, unsupported, or mis-routed answer from the current conversation into a standalone eval case in the project's JSONL eval set. Run manually with /capture-eval-case right after you spot a bad answer worth regression-testing; it reads the failing exchange from the live conversation, so it runs in the main session, not a subagent.
Ships in prompt-evaluation-claude-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Turn a failure you just witnessed into a regression test. A wrong answer is the most valuable eval input there is — it is a real failure, already stratified by reality, not a synthetic guess. This skill captures it before the context scrolls away.
The evidence lives in the current conversation: the question that was asked, the answer that came back, and the turn where you (or the user) noticed it was wrong. A subagent starts with a fresh context window and cannot see any of that, so this runs in the main session. (You may still spawn a subagent for one narrow job — confirming ground truth; see Step 3.)
Manually, with /capture-eval-case, right after an answer turns out to be:
web-search), or an agent answered from memory when it should have verified.Optional argument: name the agent, the target eval-set path, or one line on what was wrong, to skip the questions in Step 1.
The eval sets are committed and distributed with the repo, and each case is later
replayed in a fresh context where the runner sees only the case's input. So
a case cannot lean on anything outside itself — not the conversation it came from,
not your local files, not project-specific names. Both the input (the prompt)
and the criterion (the expected behavior) must be self-contained and
reproducible by anyone. Decontextualize as you capture: keep the part that
triggers the defect, drop the part that is merely your situation.
From the conversation, identify and state back to the user:
input (see "Cases must be standalone" above). If the
failing message was already standalone, take it verbatim. If it leaned on
earlier turns or project context (a file you had shown, an internal name, "the
bug above"), rewrite it into a standalone prompt that still triggers the same
defect, and strip anything private to the project. Then confirm the defect
still reproduces from the rewritten prompt alone — if it doesn't, you have
changed the test, not captured it.microsoft-search), or main-thread Claude. This decides which eval set the
case belongs to.If any of the three is ambiguous — several recent failures, or the skill was invoked generically — ask the user rather than guessing. The whole value of the case is that it targets a real, specific defect.
The agent under test usually has a canonical eval set — but it may not be one you can write to. Find it, then branch on writability:
eval-set-vN.jsonl and any README.md beside it to match its schema, ID
sequence, and tag vocabulary, so the new case fits its neighbors. The case
lands here (Step 5). In this marketplace repo, the search-agent sets live at
plugins/search-agents/evals/<agent>/ — one example layout, not a requirement.~/.claude/plugins/…), which is immutable. Do not try to write there.
Capture into an eval set in the user's own project instead, and tell them that
folding the case into the canonical upstream set means opening a PR against the
plugin's source repository.evals/<agent>/eval-set-v1.jsonl under the current working directory).Either way, the case must land somewhere the user can actually commit — never inside the read-only plugin cache.
A good criterion must encode the correct behavior or fact:
golden_answer field (Step 4). Never invent the
"correct" answer to grade against — a case with a wrong golden answer is worse
than no case.Write JSONL matching the set's schema. Required: id, input, criterion. Use
the optional fields the existing set uses (source, golden_answer, must_do,
must_not_do, tags, notes):
id — next stable ID in sequence (e.g. ms-08); never reuse a retired ID.
For a brand-new set, pick a short agent prefix and start at -01 (e.g.
ms-01).source — provenance, e.g. "observed-failure".input — the standalone prompt you settled on in Step 1 (verbatim if it was
already self-contained; otherwise your decontextualized rewrite).criterion — one sentence, an observable pass condition that the
witnessed defect would fail. This is the load-bearing field: if the bad answer
would still pass your criterion, the case does not discriminate and is
worthless. Avoid "good" / "high quality". State it against general, public
ground truth — never against project-private facts (e.g. "matches our config"),
which a shipped case cannot check.golden_answer — the verified correct answer for factual cases (enables
reference-guided judging; see eval_set.md). Omit for behavior/policy cases.must_do / must_not_do — short rubric checklist; put the specific defect in
must_not_do.tags — reuse the set's vocabulary; add one that names the failure mode.notes — human-only: what the agent actually said, and the date, so the next
reader knows the case's origin.One defect per case. If the answer was wrong in two independent ways, write two cases.
If the target set has already been measured, do not edit it in place — that
breaks cross-iteration comparison. Copy it forward to eval-set-v(N+1).jsonl,
append the new case(s) with stable IDs, and — if the set has a provenance
README.md — add an entry for the new case. If the set is brand-new and
unmeasured, appending in place is fine. See
../prompt-evaluation-claude-code/references/eval_set.md (bundled in this
plugin) for the full versioning discipline: bump-don't-mutate, stable IDs, stamp
results with the set version.
Show the user the drafted case(s) before writing. After editing, lint the files
you touched with whatever the project uses — just check in this marketplace
repo, otherwise markdownlint or the project's configured tooling — and fix any
findings.
Observed failure. You asked microsoft-search a quota question and it
answered from memory:
Q: What's the maximum number of storage accounts per Azure subscription per region?
A (microsoft-search): 250 per region.
No source, no freshness marker, no sign it treated the limit as fluid — a policy
violation. The captured case (one line in the .jsonl; pretty-printed here):
{
"id": "ms-08",
"source": "observed-failure",
"input": "What's the maximum number of storage accounts per Azure subscription per region?",
"criterion": "Treats the limit as fluid and verifies via the Microsoft Learn MCP server, marking freshness; does not assert a bare number from memory with no source.",
"must_do": ["Treat the limit as fluid", "Prefer the Microsoft Learn MCP / Azure service-limits docs", "Mark freshness or state verification is needed"],
"must_not_do": ["Assert a number from memory as current with no caveat or source"],
"tags": ["fluid", "azure", "quota", "mcp-preferred", "from-memory"],
"notes": "2026-06-26: microsoft-search answered '250 per region' with no source or freshness marker."
}
The criterion is written so the bad answer fails it: "250 per region" with no
source does not "verify … marking freshness," so the case discriminates. This is
a behavior failure, so golden_answer is omitted — the test is about
verifying, not the specific number.
README.md.What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
Other plugins' skills for the same job
npx claudepluginhub 46ki75/yaarr --plugin prompt-evaluation-claude-code