/agent-eval-harness:eval-runfrom agent-eval-harness
Executes evaluations against test cases using skill or prompt mode, scores outputs with judges, and reports results. Requires an eval.yaml config from /eval-analyze. Useful for benchmarking skills, comparing models, detecting regressions, and verifying changes.
Ships in agent-eval-harness. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
You are an evaluation executor. You run a skill against test cases, score the outputs with judges, and report results. You orchestrate by calling scripts — never duplicate their work.
For the full data flow (dataset → workspace → execution → collection → scoring), see ${CLAUDE_SKILL_DIR}/references/data-pipeline.md. For tool interception mechanics, see ${CLAUDE_SKILL_DIR}/references/tool-interception.md.
Parse $ARGUMENTS:
| Argument | Required | Default | Description |
|---|---|---|---|
--config <path> | no | auto-discover | Path to eval config |
--model <model> | no | models.skill from config | Skill model. Required if models.skill is unset in eval.yaml. |
--subagent-model <model> | no | models.subagent → falls back to skill model | Model for subagents (e.g., claude-sonnet-4-6 while main is claude-opus-4-7) |
--skill <name> | no | from config | Override the skill to test |
--run-id <id> | no | YYYY-MM-DD-<model> | Identifier for this run |
--run-dir <path> | no | resolved from config + run id | Put the run in exactly this directory; its basename is the run id and must match [A-Za-z0-9._-]+ |
--cases <id> [<id> ...] | no | all cases | Exact case IDs to run |
--baseline <run-id> | no | — | Previous run to compare against |
--no-llm-judges | no | false | Skip LLM judges (prompt, prompt_file, LLM builtins, agent). Run deterministic judges (check, Python builtins, external code). |
--parallelism <n> | no | execution.parallelism | Concurrent cases (run, judge) |
--gold | no | false | Save outputs as gold references after run |
--effort <level> | no | runner.effort from config | Agent reasoning effort; accepted values are runner-specific |
--runner <type> | no | local | local (default Steps 1–8) or harbor (containerized — skips to Harbor runner section) |
--env <name> | no | kubernetes | Harbor execution environment: podman, kubernetes, openshift (only with --runner harbor) |
--mount <source:target[:ro or rw]> | no | — | Repeatable Podman bind mount; defaults to read-only (only with --runner harbor) |
--cpus <n> / --memory-mb <MiB> | no | Harbor defaults | Hard resource limits per Harbor environment |
If --runner harbor: finish Step 0 and Step 1, then skip to the Harbor runner section below. Steps 2–6 are replaced by one run.py call.
If --config was explicitly provided, use that path directly.
Otherwise, auto-discover eval configs:
python3 ${CLAUDE_SKILL_DIR}/../../scripts/discover.py
<config>Check if the resolved config file exists:
test -f <config> && echo "CONFIG_EXISTS" || echo "NO_CONFIG"
If config is missing: bootstrap via /eval-analyze (invoked through the Skill tool) — if skills/ contains skills, suggest /eval-analyze --skill <name>; otherwise /eval-analyze --prompt <path> (prompt mode).
Once config exists, read it to understand the eval setup (skill under test, runner, dataset, outputs, judges, models, tool interception). Scripts read the same config; just warn the user about anything missing or surprising.
inputs.tools is claude-code-only (others reject it at load). If the skill uses AskUserQuestion or external APIs, verify the handlers cover them — an unintercepted tool can hang headless execution.
Only once the config exists (after any bootstrap above). If --run-dir was supplied it is authoritative: <run-dir> is that path and <id> its basename — do not run discovery. If --run-id was also supplied explicitly and differs from that basename, stop with an error; --run-dir alone is valid. Otherwise never build the path yourself; get it from the harness:
python3 ${CLAUDE_SKILL_DIR}/../../scripts/discover.py --config <config> --run-id <id>
Its output is <run-dir>. Pass --run-dir <run-dir> (not --run-id) to the scripts below; see references/execution-monitoring.md.
Persist parsed flags:
mkdir -p tmp ${AGENT_EVAL_RUNS_DIR:-eval/runs}
python3 ${CLAUDE_SKILL_DIR}/scripts/agent_eval/state.py init tmp/eval-config.yaml \
model=<model> skill=<skill> run_id=<id> baseline=<baseline> \
gold=<true/false> no_llm_judges=<true/false>
Read dataset.path from eval.yaml. Verify the directory exists and contains at least one case subdirectory:
ls <dataset_path>/ | head -20
If --cases was specified, pass the IDs to workspace.py as --cases <id> <id> ....
If no cases found, stop and tell the user clearly:
/eval-dataset to generate test cases, or /eval-analyze --update to reconfigure the dataset pathBefore setting up the workspace, verify the project's artifact directories are clean. Skills write to the project directory, so stale artifacts from previous runs contaminate results (wrong IDs, stale reports, inflated file counts).
python3 ${CLAUDE_SKILL_DIR}/scripts/preflight.py \
--config <config> \
--run-dir <run-dir> \
[--baseline <baseline-id>]
The script checks tmp/ for stale files (not skills' own state), whether <run-dir> already has results, and (with --baseline) that the baseline run exists.
CLEAN: proceed to workspace setup.DIRTY: report the findings and ask the user to choose — force clean (preflight.py --clean --force, then proceed), change run-id (append a suffix like -opus-v2, then re-run preflight with --clean on the new id), or abort for manual cleanup.MISSING_BASELINE (exit 2): the --baseline run-id wasn't found. The script lists nearby run-ids — confirm the right one with the user.Create an isolated workspace with the test cases and output directories:
python3 ${CLAUDE_SKILL_DIR}/scripts/workspace.py \
--config <config> \
--run-id <id> \
[--cases <id> [<id> ...]] \
[--json]
The script prints WORKSPACE: <path>, CASES: <count>, BATCH: <path>. Report these to the user. If inputs.tools is configured, it also prints HOOKS: N tool interceptors configured.
--json (for CI) prints one JSON object on stdout instead and sends the text to stderr. See references/data-pipeline.md for its fields.
If the case count is 0, stop — the filter matched nothing.
inputs.tools configured)If eval.yaml has inputs.tools entries, this step is mandatory for Claude Code
(other runtimes reject inputs.tools). workspace.py emits a skeleton in
tool_handlers.yaml; you must resolve each handler's prompt into concrete runtime
checks (input_filters, env_checks, case_overrides). Do not skip this even when
the eval.yaml is unchanged — the workspace is created fresh each time.
Read ${CLAUDE_SKILL_DIR}/references/tool-interception.md for the full format, field reference, and resolution examples. Then read <workspace>/tool_handlers.yaml and for each handler:
input_filters for Bash, env_checks for services, case_overrides for deterministic answersinput_filters — without them the handler is non-functionalWrite the resolved handlers back to tool_handlers.yaml.
Run the eval headlessly against test cases. execute.py auto-detects the execution mode from the config: skill mode (execution.skill + arguments) invokes the skill, while prompt mode (execution.prompt) sends the prompt directly with no skill wrapper. For how the mode is selected and how templates are resolved, see ${CLAUDE_SKILL_DIR}/references/execution-modes.md.
In case mode (default), execute.py runs once per case, each with its own stdout.log and subagent transcripts. In batch mode, all cases run in one invocation via batch.yaml.
If hooks: is configured, execute.py runs the lifecycle hooks itself (before_all, before_each/after_each, after_all — guaranteed, even on failure). Logs go to <run-dir>/hooks/.
python3 ${CLAUDE_SKILL_DIR}/scripts/execute.py \
--config <config> \
--workspace <workspace_path> \
[--skill <skill_name>] \
[--skill-args "<skill arguments>"] \
--model <model> \
--run-dir <run-dir> \
[--agent <runner>] \
[--subagent-model <model>] \
[--mlflow-experiment <name>] \
[--effort <level>] \
[--parallelism <n>]
Pass --skill/--skill-args only to override the config (never --skill in prompt mode).
Launch with run_in_background: true and do NOT redirect its output (no >, |, tee, 2>&1) — a redirect diverts the stream Claude Code's background viewer reads and leaves it blank. execute.py mirrors its console to <output_dir>/console.log.
When it finishes, read run_result.json — if exit_code is non-zero, report the failure and stop. If stderr.log ends with a bg-wait-ceiling ERROR:, see the reference below. For session lifecycle, polling, problem detection, and CLI fallbacks, see references/execution-monitoring.md.
Distribute workspace outputs into per-case directories so judges can score each case independently:
python3 ${CLAUDE_SKILL_DIR}/scripts/collect.py \
--config <config> \
--workspace <workspace_path> \
--run-dir <run-dir>
Read the collection summary (JSON file — read it with cat or jq, not state.py):
cat <run-dir>/collection.json
Report per-case counts. If any case has 0 artifacts, warn — the skill may not have produced output for that case.
Run all configured judges against the collected outputs. Five judge types: builtin, inline check, LLM (prompt/prompt_file/llm_rubric), external module/function, and agent (a tool-using judge run through the runner; writes output/score.json). All take optional arguments:. See references/data-pipeline.md.
If --no-llm-judges was specified, skip judges that make LLM API calls (prompt, prompt_file, LLM builtins, and agent judges). Run deterministic judges only (check, Python builtins, external code).
python3 ${CLAUDE_SKILL_DIR}/scripts/score.py judges \
--run-dir <run-dir> \
--config <config> \
--workspace <workspace_path> \
--model <model> \
[--parallelism <n>] \
[--no-llm-judges] # if the run skips model judges
If hooks.before_scoring is configured in eval.yaml, score.py runs those hooks before judge execution. Pass --workspace and --model so hook environment variables are populated.
Judges receive the case outputs record (files, metadata, tool_calls, logs, annotations). Field reference: references/data-pipeline.md.
If --baseline was specified, also run pairwise comparison:
python3 ${CLAUDE_SKILL_DIR}/scripts/score.py pairwise \
--run-dir <run-dir> \
--baseline <baseline_id> \
--config <config> \
[--parallelism <n>]
min_win_rate: see data-pipeline.md.
Read the full results:
python3 ${CLAUDE_SKILL_DIR}/scripts/agent_eval/state.py read <run-dir>/summary.yaml
summary.yaml carries judges, per_case, unmeasured, judge_usage, total_cost_usd, plus pairwise when --baseline was used (keys: data-pipeline.md).
Read the summary and analyze the results. Read ${CLAUDE_SKILL_DIR}/prompts/analyze-results.md for the full analysis framework and output format. Lead with Recommendation (self-contained — many readers only read this section). Save the analysis to <run-dir>/analysis.md with YAML frontmatter (agent, model, date) — see the prompt file for the template.
Generate HTML report:
python3 ${CLAUDE_SKILL_DIR}/scripts/report.py \
--run-dir <run-dir> \
--config <config> \
[--baseline <baseline_id>] \
--open
Tell the user the report is at <run-dir>/report.html.
If --gold flag: After scoring, copy collected artifacts to dataset case dirs as reference files. Report which cases were saved.
Suggest next steps (include --config <config> if a non-default config was used):
/eval-review --run-dir <run-dir> (plus --config <config> if non-default) for interactive human review of the results/eval-optimize --model <model> for automated improvement based on failures/eval-mlflow --run-id <id> to log results to MLflowIf mlflow.experiment is configured in eval.yaml:
Use the Skill tool to invoke /eval-mlflow --action log-results --run-dir <run-dir> --config <config>
--runner harbor)When --runner harbor is specified, skip Steps 2–6 and call run.py instead —
it handles task generation (or reuse), harbor run, per-case judging (in-container),
result mapping, and report generation in one call:
# Run under the eval-harness venv interpreter so compiled deps load with the
# correct ABI and the process is never re-exec'd mid-run. Falls back to system
# python3 if the venv is absent. The venv holds only third-party deps, so the
# plugin root (source of the agent_eval package) must be on PYTHONPATH.
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$CLAUDE_SKILL_DIR/../..}"
VENV_PY="$PLUGIN_ROOT/.eval-venv/bin/python3"
[ -x "$VENV_PY" ] || VENV_PY=python3
PYTHONPATH="$PLUGIN_ROOT:$(pwd)${PYTHONPATH:+:$PYTHONPATH}" "$VENV_PY" -m agent_eval.harbor.run \
--config <config> --model <model> \
--output <run-dir> \
--tasks-dir <tasks-dir> --jobs-dir <tmp-jobs> \
[--image <image>] [--agent <agent>] [--n-concurrent N] \
[--env kubernetes] [--mount <source:target:ro>] [--no-llm-judges] \
[--cpus N] [--memory-mb MiB]
For runner.type: codex, run.py selects Harbor's Codex agent, passes
runner.effort as reasoning_effort, and passes every runner.plugin_dirs
entry's complete manifest-declared skill roots. Do not narrow an orchestrator to its primary
skill directory; sibling dependencies must remain discoverable. Use --mount
with Podman for large datasets instead of copying them into each
task. Kubernetes requires cluster-visible storage rather than host paths.
Cluster-specific config (namespace, credentials secret) is read from a
.env file in the project root. Create it with AGENT_EVAL_K8S_NAMESPACE
and AGENT_EVAL_K8S_CREDENTIALS_SECRET — run.py loads it automatically.
Tasks come from /eval-dataset (which emits Harbor task packages via
scripts/harbor.py). If --tasks-dir already has them, run.py reuses them; if
empty, it generates on the fly (needs --image). The output is a standard
run_result.json + summary.yaml + report.html — then continue with Step 6
pairwise (if --baseline) and Step 8 (MLflow) as normal. See
deploy/harbor/README.md for image build, credentials, and environment setup.
--no-llm-judges is a generation-only option. It requires an image and either
an empty tasks directory or --regenerate; generated packages are stamped as
deterministic-only and cannot later be reused for a full judge run.
--runner evalhub)When --runner evalhub is specified, skip Steps 2–8 and call the EvalHub
runner instead — it creates ConfigMaps, submits a job to EvalHub, polls for
completion, and maps the results back:
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$CLAUDE_SKILL_DIR/../..}"
VENV_PY="$PLUGIN_ROOT/.eval-venv/bin/python3"
[ -x "$VENV_PY" ] || VENV_PY=python3
PYTHONPATH="$PLUGIN_ROOT:$(pwd)${PYTHONPATH:+:$PYTHONPATH}" "$VENV_PY" -m agent_eval.evalhub.runner \
--config <config> --model <model> \
--output <run-dir> \
[--evalhub-url <url>] [--namespace <ns>] [--project-dir <path>]
The runner creates K8s ConfigMaps for the eval config and project resources
(via k8s_resources), submits the job to EvalHub (which creates a Job pod
running the adapter in-process), polls until completion, and maps the results
into the standard summary.yaml + report.html. No image rebuild needed —
ConfigMaps carry the project-specific content.
python3 ${CLAUDE_SKILL_DIR}/scripts/agent_eval/state.py so flags and results survive context compression.$ARGUMENTS
prompts/analyze-results.md (opens in a new tab)prompts/comparison-judge.md (opens in a new tab)references/data-pipeline.md (opens in a new tab)references/execution-modes.md (opens in a new tab)references/execution-monitoring.md (opens in a new tab)references/tool-interception.md (opens in a new tab)scripts/collect.py (opens in a new tab)scripts/execute.py (opens in a new tab)scripts/preflight.py (opens in a new tab)scripts/report.py (opens in a new tab)scripts/score.py (opens in a new tab)scripts/tools.py (opens in a new tab)scripts/workspace.py (opens in a new tab)scripts/workspace_files.py (opens in a new tab)scripts/agent_eval/__init__.py (opens in a new tab)scripts/agent_eval/_bootstrap.py (opens in a new tab)scripts/agent_eval/actions_mask.py (opens in a new tab)scripts/agent_eval/agent/__init__.py (opens in a new tab)scripts/agent_eval/agent/base.py (opens in a new tab)scripts/agent_eval/agent/claude_code.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fullsend-ai/agent-eval-harness --plugin agent-eval-harness10 skills in this plugin
/eval-analyzeGenerate eval.yaml for the agent eval harness. Two modes - (1) Skill-based - examines SKILL.md, sub-skills, scripts, test cases to verify implementation quality, OR (2) Prompt-based - tests agent capabilities using custom analysis prompts (documentation effectiveness, pattern understanding, API usage, constraint compliance). Produces complete config with execution mode, dataset schema, outputs, judges, models, thresholds. Use when setting up evaluation, testing skills/documentation, adding quality checks, or benchmarking. Auto-triggered by /eval-run when eval.yaml missing. Triggered by "how do I know if my skill/docs work?"/eval-anovaRun Design-of-Experiments (DoE) evaluations with ANOVA over a matrix of agent configurations — comparing models, thinking-effort levels, prompts, or other factors across shared test cases, with repeated-measures / mixed-effects statistics that account for case difficulty plus a cost/quality Pareto view. Use whenever the user wants to compare models or configurations on an eval, decide which model or config is best, sweep or grid factors, run replications, or check whether a difference in eval scores is statistically significant (F, p, effect size) — even if they don't say "ANOVA" or "DoE". Also use when an eval.yaml has a matrix block or the user asks to fan an eval out across configurations.Other plugins' skills for the same job