Running evals¶
Why a skill needs evaluations, and how to write them, is in writing-skills.md (rules SK-29 and SK-30). This page is how to run them in this repository.
cd plugins/<plugin>
env -u ANTHROPIC_API_KEY claude plugin eval . --model sonnet --judge-model sonnet
env -u ANTHROPIC_API_KEY makes the run use the Claude subscription instead of a paid key. The
results land in plugins/<plugin>/evals/results/<timestamp>/.
An llm grader sees only the final reply¶
An llm grader shows its judge one thing, chosen by focus. The default, last_message, is the
run's final reply and nothing else. A grader that checks what the run did—the command it ran,
the file it wrote or left alone, the skill it loaded, the order of its steps—then judges what the
reply says it did. A run that claims "I committed with the given identity" passes without a commit
having happened. That is the claim SK-30 says not to grade, and the score shows no sign of it.
Such a grader sets focus: trace. The judge then gets the run's trace, one JSON object per line:
its messages and its tool calls with their inputs.
---
type: llm
focus: trace
---
PASS if the trace shows a Bash call running `git commit` with `-c user.name="Claude Agent"`.
FAIL if no such call was made, even when the reply says it committed.
Quote the call that decides the verdict.
The final reply is enough when the grader judges only what the reply says: the answer, the
recommendation, the question it asks, the table it shows. Graders that need neither the reply nor a
judge stay deterministic: tool_used for "the skill fired" or "no Edit was made", regex with
target: trace for a command string, file_exists for a file.
The other values: files lists the paths the run created, not their contents; {source: file,
path: <path>} shows one file the run produced; mock_calls lists the calls to mocked MCP servers.
Whatever the focus, the judge gets at most 100,000 characters—the first 80,000 and the last
20,000, the middle elided, so a criterion about a long run's middle steps belongs in a
deterministic grader. (Measured with Claude Code 2.1.302.)
A plugin with dependencies¶
The eval sandbox loads no installed plugin, so claude plugin eval plugins/workflow cannot satisfy
workflow's git-flow and superpowers@claude-plugins-official. Claude Code 2.1.300 then leaves
the plugin unloaded, runs both arms without it and scores every case as if the skill did not exist.
It prints no error. Only the plugin_errors in a run's trace say dependency-unsatisfied. No eval
option adds a plugin. A case's plugins: field does, but only for directories below the eval
target, and plugin@marketplace ids are refused. So run such a plugin's evals through the wrapper,
which copies the plugin and its dependencies into one scratch root, lists them in every case there,
and exits 3 when any run's trace reports a plugin error:
env -u ANTHROPIC_API_KEY bash scripts/tools/eval-plugin.sh workflow --case 'coordinator-*' \
--trust-plugin --scaffold
It takes a dependency from this marketplace from plugins/, and one from another marketplace from
its installed copy (claude plugin install <dep> first). The results land in
plugins/<plugin>/evals/results/<time>-<plugin>-<case or tag filter>-<model>/, with a -2, -3 …
suffix when that folder exists already, so runs started in the same second never share one. That
makes it safe to run one model per terminal in parallel:
env -u ANTHROPIC_API_KEY bash scripts/tools/eval-plugin.sh workflow --case 'work-on-*' --model sonnet &
env -u ANTHROPIC_API_KEY bash scripts/tools/eval-plugin.sh workflow --case 'work-on-*' --model haiku &
wait
--output-dir overrides the name and is used as given, also when it exists. The wrapper works for
a plugin without dependencies too, and checks the plugin loaded.
Running the evals in a Docker Sandbox¶
A case's scaffold_script runs as you, on your machine, with your tokens in reach (#213). So on
Linux with sbx installed the wrapper runs the eval in a throwaway
Docker Sandbox (sbx) by default (owner decision
d278-sbx-default); every command above does.
--no-sbxruns the eval on the machine instead.--sbxinsists on the sandbox: it fails wheresbxis missing.- Without
sbxon thePATH(in CI, in a sandbox without it) the eval runs on the machine. On Windows the sandbox runs only with--sbx(below). - When the sandbox cannot be created, the wrapper stops. It never falls back to the machine on its own.
bash scripts/tools/eval-plugin.sh workflow --model sonnet --trust-plugin --no-publish --scaffold
bash scripts/tools/eval-plugin.sh workflow --no-sbx --model sonnet --trust-plugin --no-publish --scaffold
The sandbox run prepares the scratch root on the host as usual, then creates a sandbox named
eval-<plugin>-<time>-<pid>, runs claude plugin eval inside it and removes it afterwards, also
when the eval fails. Only four things are mounted, each at its host path: the scratch root, the
new results folder, a temporary folder for the runs' kept directories (left in place with
--keep-temp, as on the host), and the claude binary read-only—on Linux the host's own—so
the eval runs the same Claude Code version as the host (the sandbox image ships an older one).
Nothing else of the host is visible.
The run authenticates through the Anthropic secret sbx's proxy adds for api.anthropic.com, so
ANTHROPIC_API_KEY plays no part.
Network. The eval needs only api.anthropic.com. sbx cannot narrow a sandbox to one host—a
** deny overrides any allow—so the sandbox gets sbx's global allow list minus the hosts whose
secrets sbx's proxy would add: github.com, *.github.com, *.githubusercontent.com,
*.aikido.dev, context7.com and *.context7.com. A new secret on another host needs a deny here
too.
Shell tools work. In the sandbox the eval's own OS sandbox starts, so a case's Bash calls run
(with --allow-tools Bash). On the host they fail with apply-seccomp (next section).
Cost (Claude Code 2.1.304, sbx 0.49.1, one case with three Haiku runs): creating the sandbox
takes about 5 s, and the eval itself as long as on the host (75–105 s against 89 s, the model's
variance dominates). The VM holds about 1.3 GB idle and 1.6 GB at its peak, against 0.26 GB for the
same run on the host; EVAL_SBX_MEMORY sets its limit (default 4g).
The sandbox needs sbx installed and the user in the kvm group. The root step that adds the group
is prepare in the one-time root steps of linux-host.md.
On Windows (Git Bash)¶
On Windows the sandbox is opt-in: without --sbx the eval runs on the machine as before, also
with sbx installed. With it, the wrapper runs the same way as on Linux, from Git Bash (#522):
env -u ANTHROPIC_API_KEY bash scripts/tools/eval-plugin.sh git-flow --case 'commit-*' --sbx
That is worth it here more than on Linux: native Windows has no backend for the eval's own OS sandbox, so a case's Bash calls cannot run on the machine at all, while in the VM they do (#311).
- Finding
sbx.winget installputs it in%LOCALAPPDATA%\DockerSandboxes\bin, which is not on Git Bash'sPATH. The wrapper takesSBX_BINwhen set, thensbxon thePATH, then$LOCALAPPDATA/DockerSandboxes/bin/sbx.exe, and stops with exit 2 when none exists. - Paths. sbx mounts
C:\xin the VM at/c/x. Git Bash's own paths do not exist there:/tmpis an alias of the user's Temp folder. Sosbx createmounts each folder from its Windows path (C:/Users/<user>/AppData/Local/Temp/tmp.X), and every pathsbx execgets is in drive form —/tmp/tmp.Xbecomes/c/Users/<user>/AppData/Local/Temp/tmp.X, a results folder belowD:\aise\claudebecomes/d/aise/claude/…. The wrapper converts both itself and runs both calls withMSYS_NO_PATHCONV=1, so Git Bash rewrites none of them, whatever the caller exports. - The
claudebinary.claude.exedoes not run in the Linux VM. The first run per Claude Code version downloads the Linux build of the host's version fromhttps://downloads.claude.ai/claude-code-releases/<version>/linux-x64/claude, checks it against that version'smanifest.json(platforms["linux-x64"].checksum), and keeps it in%LOCALAPPDATA%\claude-eval\<version>\, mounted read-only. Later runs reuse it while its checksum still matches, and download it again when it no longer does. A failed download or a checksum mismatch stops the run with exit 2 and leaves no partial file behind. The manifest is read on every run, so a run needs that host.
The kept run directories the VM seals with mode 000 reach NTFS as ordinary files, so cleaning up
after the run works as on Linux. On this machine Claude in a sandbox signs in to Anthropic with
/login, which sbx keeps on the host as its anthropic OAuth sign-in; no token enters the VM
(secrets.md, #521, #753).
When the run cannot execute the helper¶
A run's shell tools work only inside Claude Code's OS sandbox, and that sandbox does not start on
every machine: native Windows has no backend, and on the Linux host every Bash call fails with
apply-seccomp: … nested userns is capability-restricted, because Ubuntu sets
kernel.apparmor_restrict_unprivileged_userns=1. GitHub is out of reach for the same reason. So a
real-task case gets the helper's real output instead: record it once (pr-watch list --repo … >
resources/pr-watch-list.json), keep it in the case's resources/, and copy it into the run's
workspace with a scaffold_script (plugins/git-flow/evals/open-prs-what-is-open/ is the
pattern). The prompt says only that the output of the commands is saved under the command's name,
never which command or what it shows. The graders hold what the recording implies, PR by PR.
context.add_dirs did not reach the run (Claude Code 2.1.296: additionalWorkingDirectories
stayed empty), so use the scaffold. Such a suite runs with --scaffold:
cd plugins/git-flow
env -u ANTHROPIC_API_KEY claude plugin eval . --tag open-prs github-issues --scaffold \
--model haiku --judge-model sonnet
With the output already in the workspace, Haiku often reads the file and answers without loading
the skill: in #31 open-prs fired in 7 of 12 Haiku runs and github-issues in 2 of 12, against
every run on Opus and Sonnet. Such a skill does not list haiku in tested-models until it fires
reliably there; its content graders still count, since they decide whether the skill helps when
it does load.
The workflow plugin¶
workflow depends on git-flow and superpowers, so its evals always go through the wrapper.
--scaffold copies each case's fixture (a small repository, recorded gh output) into its
sandbox; --allow-tools Edit Write lets the cases that check "no file changed" see an edit if one
is made. The default judge is Haiku; --judge-model sonnet judges the work-on cases more
reliably.
bash scripts/tools/eval-plugin.sh workflow --model sonnet --trust-plugin --no-publish --scaffold --allow-tools Edit Write
scripts/tests/eval-plugin-test.sh tests the wrapper itself, on Linux and in Git Bash on Windows
(ci/checks.md).