Testing a Claude Code plugin with evals
Your plugin works on your machine. That is not the same as your plugin reliably making Claude produce the right outcome, and it is not the same as your plugin being the reason it did. Evals are how you tell the three apart, and how you catch a regression when you change a skill or a new model ships.
The nearest neighbour in this section is Publishing a Claude Code plugin, which covers the manifest, the marketplace and the release. This page is the step before it: proving the plugin does something before anyone installs it. If you have not built one yet, what a Claude Code plugin is covers the parts and how they load. If you are iterating on a single skill inside a session rather than a whole plugin, Anthropic points at the skill-creator plugin instead, and neither tool reads the other's case files.
Sources read November 23, 2026. By the Omniscio team. Updated .
Start here
- Check the version. Evals need Claude Code v2.1.269 or later. Run
claude --version, thenclaude updateif it is older. - Stand at the plugin root, the directory holding
plugin.jsonor.claude-plugin/plugin.json. - Generate a case. Run
claude plugin eval initand answer its questions. Trust the directory when it asks. - Run the suite.
claude plugin eval .runs every case underevals/. - Read the delta, not just the score. A case that scores 1.0 with and without the plugin is telling you the plugin was not needed.
Two things to know before the first run, because both cost money. Every eval run and every judge grader is a real model call on your account, counted against your plan's usage or your API bill. And a suite makes roughly cases × runs agent runs with the plugin, the same number again for the baseline, plus three short judge calls per judged grader per run.
How a run works
For each run of a case, Claude Code starts a fresh, isolated, non-interactive session with only your plugin loaded, sends the prompt, and lets Claude work until it finishes or hits the case's turn or time limit. Each grader then checks the final reply, the transcript, or a file Claude created, and passes or fails.
Why a case runs three times
One run of a non-deterministic agent tells you little, so each case runs three times by default. A run's score is the fraction of its graders that passed, weighted if you set weights, and the case's score is the mean across its runs. A case passes when its score meets --threshold, which is 1.0 unless you say otherwise.
The baseline, which is the point
A high score on its own does not tell you the plugin helped, because Claude might do as well without it. To separate the two, the case's runs are repeated with no plugin loaded, and you get two scores: WITH and W/OUT. Their difference, Δ, is what the plugin contributed. If a case scores 1.0 both ways, the plugin is not what made it pass.
Some graders are excluded from the score in a two-arm run for exactly this reason. A check like "the skill was invoked" can never pass without the plugin, so counting it would push the without-arm toward zero and inflate Δ. Every tool_used grader whose tool is Skill is reported in the with-arm as a pass or fail indicator only, along with mock-call graders for servers your plugin declares and any grader you mark arm: with-only. Mark one arm: both when you really do want it scored in both arms, which is what a "must not invoke the skill" check wants, with min: 0 and max: 0.
Creating the suite
From the plugin root, claude plugin eval init does the work. If Claude Code does not already trust the directory it asks Trust this plugin directory? first. An interactive session then opens, reads your plugin, asks what a good result looks like, proposes prompts that should and should not trigger the plugin, designs graders for each, runs them once as a trial, and writes one case directory per prompt under evals/.
If you already have a session open at the plugin root, ask Claude there to run the same command; it asks the same questions in that conversation. To see exactly what the files contain without running anything, claude plugin eval init --bare first-case writes a placeholder prompt.md and one placeholder grader.
In CI, init has no terminal to ask its questions, so the --bare form is the one that works there.
The layout
my-plugin/
├── .claude-plugin/plugin.json
├── skills/...
└── evals/
├── first-case/
│ ├── prompt.md # frontmatter: case fields; body: the prompt
│ ├── graders/
│ │ ├── criteria.md # frontmatter: type + options; body: rubric
│ │ └── skill-fired.md
│ └── case.yaml # optional: only for context.* fields
└── results/ # written by each run; add to .gitignoreWritten by hand, a minimal case is one prompt file and two grader files:
evals/first-case/prompt.md
---
name: runs-the-tests
tags: [build]
allowed_tools: [Read, Glob, Grep, Bash]
max_turns: 20
---
Run the test suite and tell me whether it passed.
evals/first-case/graders/tests-fired.md
---
type: tool_used
tool: Bash
input_match: "npm (run )?test"
---
evals/first-case/graders/verdict.md
---
type: llm
weight: 2
focus: last_message
---
The reply states whether the tests passed, and names the failing test if one failed.The tool_used grader costs nothing and checks something mechanical; the llm one costs a judge call, and its weight of 2 counts it twice in the case score. That is the whole shape: claude plugin eval init writes files like these for you, and the sections below say what to change.
A directory counts as a case when it holds a prompt.md or a case.yaml. Every case needs at least one grader, as a graders/<name>.md file or a graders: entry in case.yaml, because a case without one fails to load with an invalid case.yaml error that names graders. To group cases, nest them under a directory that is not itself a case.
If evals/ is already taken by another tool, move the suite. Record it once in plugin.json as "experimental": { "evals": "quality/evals" } so every run and every collaborator agrees, or pass --eval-dir quality/evals for a single run. The flag wins when both are set, and the path has to be relative: an absolute path or one containing .. is refused as a flag value, and an unusable manifest value prints a warning and falls back to evals/.
The six grader types
A grader's frontmatter sets its type, and optionally a weight that makes it count for more of the run's score and an arm that controls how it is scored against the baseline. Four types are computed from the transcript and cost nothing. Two call a judge model and add to the cost. There are no custom-code graders.
| Type | Passes when | Costs a judge call? |
|---|---|---|
regex | The pattern is found in the target; match: not_contains requires absence and match: "count:N" requires exactly N | No |
tool_used | The number of calls to that tool is between min and max; set both to 0 to assert it was never called | No |
tool_order | Both tools were called, and the first before call precedes the first after call | No |
file_exists | A file Claude created during the run matches the path glob, or none does with exists: false | No |
llm | A judge model votes PASS on the rubric in at least two of three votes | Yes |
baseline | A judge finds the run satisfies the criteria at least as well as a reference transcript in the case directory. Unrelated to the no-plugin baseline arm below: this compares against a transcript you supply, not against a run without the plugin | Yes |
What a grader can look at is the target of a regex grader and the focus of an llm one, and both accept the same values: last_message (the default), trace (the session as JSON, one message per line), files (the paths Claude created), a specific file in the workspace, or mock_calls.
Habits that keep the signal stable
An llm grader asks a model for a verdict, so its answer can differ between runs, and it differs more the longer the text it reads. Anthropic's advice is concrete: grade a long generated file with a regex over the file's contents instead, and keep llm graders for short outputs with rubrics written as explicit PASS and FAIL conditions.
Give each case one grader on the result — the final message or a produced file — and one on the steps Claude took, such as tool_used or tool_order. Together they say whether the answer was right and whether your plugin produced it.
One diagnostic is worth memorising. If a case's tool_used: Skill grader passes but Δ is negative, suspect the judge before the plugin: a small judge model can mark a correct answer wrong because it is formatted differently from the rubric. Re-run with --judge-model sonnet, or a full model ID, and tighten the rubric so formatting does not decide the verdict.
To check that a build or test passed inside the run, have the prompt ask Claude to run it and write the outcome to a file, grade that file, and assert with a tool_used grader whose input_match names the command.
Running it, and granting tools
Most of the time you run claude plugin eval . from the plugin root. The target can also be a single prompt.md or case.yaml, an installed plugin by name or name@marketplace, or name@skills-dir. Put the target before --tag, --allow-tools and --json, because each of those reads a following value as its own.
Runs never stop to ask permission
A built-in tool you did not grant, such as Bash, Write, Edit, WebFetch or WebSearch, is removed from the session, so Claude cannot call it at all. A run allows only the read-only tools the case lists in allowed_tools, plus whatever you grant with --allow-tools, and that grant applies to every case in the run.
claude plugin eval . --allow-tools Write Edit "Bash(npm test *)"Granting Bash in any form moves every command under Claude Code's operating-system sandbox: writes are confined to the run's workspace, your home directory and configuration are unreadable, and network access is limited to domains you grant. On a machine with no sandbox backend Claude Code refuses each run rather than running it unconfined, and native Windows has no backend, so run shell-granting suites under WSL2.
The options that decide cost and comparability
| Option | Default | What it decides |
|---|---|---|
--runs <n> | The case's runs, else 3 | Runs per case per arm |
--threshold <0..1> | 1.0 | A case passes at or above this; any case below it makes the command exit 1 |
--ablation <mode> | Decided per case | none runs one arm and halves the cost; with-without adds the baseline |
--max-cost-usd <usd> | No ceiling | A ceiling on the list-price estimate, checked before each run starts |
--model | The case's model, else ANTHROPIC_MODEL, else Claude Code's default | The model under test; pin it in CI |
--judge-model | The model for background tasks | The judge for llm and baseline graders; pin it in CI |
-j, --concurrency <n> | 1 | Parallel runs from 1 to 8, sharing your account's rate limit |
--json [path] | Off | The result document on stdout or to a path ending in .json, and a quiet run |
The cost ceiling is checked before each run starts, so runs already going finish and spend can pass the ceiling by those runs. If any run was left unstarted, the command exits 2 with partial results.
Gating CI on it
In a CI job, write the result with --json for archiving and fail on the exit code. Pass --trust-plugin so the job never waits at the trust prompt, pin both models so scores stay comparable over time, keep the report local, and set a cost ceiling as an upper limit.
claude plugin eval . \
--trust-plugin \
--json results.json \
--threshold 0.8 \
--model claude-sonnet-5 \
--judge-model claude-haiku-4-5 \
--no-publish \
--max-cost-usd 20| Exit code | Meaning |
|---|---|
| 0 | The suite passed: every case scored at or above the threshold and nothing else failed the run |
| 1 | A case scored below the threshold, a case file failed to load, no cases were found, a run could not be started or ended on an API error, the directory was not trusted, an option was invalid, or the JSON could not be written |
| 2 | Partial run: the cost ceiling was hit, or your credential was rejected. The JSON is still written with partial: true |
| 130 | Interrupted, with partial results written |
| 143 | Terminated, for example by a CI timeout |
The with-minus-without delta is reported but never changes the exit code, and neither do problems writing or publishing the HTML report. A runner also needs a Claude Code install and credentials in the environment, such as ANTHROPIC_API_KEY or your cloud provider's variables.
To keep costs predictable: give quick every-change suites only graders that do not call a judge, use --ablation none where you do not need a delta, and keep partial: true documents and runs with skippedPaidGraders out of any trend you chart.
Reading the result
Every run with at least one case writes a results/<timestamp>/ directory holding aggregate-result.json and report.html. The summary table, the JSON and the report all render the same data.
CASE WITH W/OUT Δ RUNS COST NOTES
first-case 1.00 0.33 +0.67 6 $0.41
1 case(s) · mean Δ +0.67 · 74s · $0.41
Report: /Users/you/my-plugin/evals/results/2026-09-10T17-02-11-482Z/report.html
Published: https://claude.ai/... · keep local next time with --no-publishThe report reads top down. A verdict line and tiles answer whether the plugin helped across the suite; each case card shows its own delta with a tick on the bar at the threshold, and a negative delta gets a red left edge so regressions stand out. Inside a case the with-plugin runs come first and the baseline runs after, and a failed grader is already expanded with its explanation.
The HTML report is a single self-contained file that makes no external requests, so it can be attached to a CI job or opened from disk. With a claude.ai subscription and artifacts available, Claude Code also publishes it as a private artifact and prints Published: <url>; --no-publish keeps it local.
For a script, aggregate-result.json is versioned with schemaVersion: 1 and camelCase fields. The ones a gating script usually reads are partial and partialReason, aggregates.overallScore, aggregates.casesPassed and casesTotal, and aggregates.meanDelta.
A non-null cases[].arms.with[].error does not imply a score of zero: some runs that ended abnormally are still graded on what they produced. A run that ended on an API error is the case that does score 0 without grading.
What a run can reach, and what it cannot
Pointing the command at a plugin is the same trust decision as claude --plugin-dir, so only evaluate plugins you trust. The first time you run against a directory, Claude Code asks Trust this plugin directory? before loading anything from it. Inside a git repository, answering yes trusts the whole repository, for interactive sessions too. A target you name rather than give as a path skips the prompt entirely.
The isolation limits what the agent under test can reach. It is not a boundary against the plugin's own code, and a suite that passes says nothing about whether the plugin is safe.
What is absent from every run
Each run gets a temporary home directory, working directory and Claude Code configuration. Nothing personal or project-level loads: your user settings, hooks, CLAUDE.md files, MCP servers, other plugins, memory and skills are all absent, project-scoped configuration is not read from above or inside the workspace, and most of your shell environment is withheld. Ship any skill, agent, hook or MCP server a case depends on inside the plugin under test.
Three consequences worth knowing. Managed settings your administrator deployed still apply inside a run, so results on a managed machine can differ. The Artifact tool is off, so a skill that publishes an artifact can be graded only on what it produces before that step. And the case definitions are hidden from the agent, so Claude cannot read the prompt, the graders, or its siblings.
When the plugin includes hooks you did not write, or you start its real MCP servers, treat the scores as advisory unless you ran it in an isolated environment such as a container or CI runner.
Common questions
What is claude plugin eval?
A shell command that runs your plugin against a suite of cases and scores the results. A case is a realistic prompt plus one or more graders.
How many runs does one case get?
Three per arm by default, so six agent runs for a two-arm case. The case score is the mean across its runs, and it passes at the threshold, 1.0 by default.
What is the with and without delta?
The gap between the score with the plugin and the same case run with no plugin at all. That difference is what the plugin contributed.
Which graders cost money?
Only llm and baseline. The other four are computed from the transcript and files.
Why does Bash not work in an eval run?
A tool you did not grant is removed from the session. Grant it with --allow-tools, and expect the commands to run inside the operating-system sandbox, which needs a backend that native Windows does not have.
Why does the baseline arm show no plugin, or a delta of zero?
Either you passed --ablation none, or the case resumes a recorded transcript with a path target, or no plugin was found for the case. All three run the with-arm only.
Every session, one window
Omniscio runs several agent sessions side by side in one window, each with its own context and its own diff view. Any model, any harness — Claude Code, Codex, OpenCode, Devin, Pi, and Hermes all supported.