agentleFS
WhatIfWeDigDeeperWhatIfWeDigDeeper/agent-skills/evals/CLAUDE.md

agent-skills / evals

CLAUDE.md2 starsChanged 49 days agoMITView on GitHub

This file provides guidance when working in the evals/ directory. It auto-loads in Claude Code when you read or edit files here.

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Two-turn evals via followup_prompt: if an eval has this field, tell the executor subagent to issue it as a second user message after …

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 28,633 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Evals

This file provides guidance when working in the evals/ directory. It auto-loads in Claude Code when you read or edit files here.

Evals and Benchmarking

  • Each skill with an evals/ directory should have a corresponding evals/<skill-name>/benchmark.json.
  • After running evals for a skill, always update evals/<skill-name>/benchmark.json with the new results. Do not leave stale benchmark data.
  • benchmark.json run entries are the authoritative source for pass rates — benchmark.md prose sections can silently fall behind. When a spec or review cites a baseline percentage, always verify it from the pass_rate field in benchmark.json's runs array, not from the prose description.
  • The benchmark.json format mirrors evals/ship-it/benchmark.json: a metadata block, a runs array (one entry per eval × configuration), and a run_summary with mean/stddev/min/max stats plus a delta section comparing with_skill vs without_skill. The top-level notes array belongs at the root of the file, not inside metadata — place it between the closing } of metadata and the opening [ of runs.
  • Eval evidence strings must be repo-relative — no absolute /Users/... paths in benchmark.json or grading-*.json.
  • grading.json must include a summary block or aggregate_benchmark.py will report 0% for all runs even when expectations pass. Required shape: {"summary": {"passed": N, "failed": N, "total": N, "pass_rate": 0.N}, "expectations": [{"text": "...", "passed": true, "evidence": "..."}]}. The expectations field names must be exactly text, passed, and evidence — the eval viewer depends on them.
  • After updating benchmark.json, immediately update the Eval Δ column in the README.md Available Skills table to reflect the new pass-rate delta (e.g. +62%). Do not finish the task or open a PR without doing this. Also check the PR description — if it mentions the old delta percentage, update it to match. Also update the benchmark.md Summary table — its ± stat values mirror benchmark.json's run_summary and are not auto-generated; they drift silently when run_summary is corrected. Also update the Eval cost bullet in the skill's Skill Notes section in README.md — it contains the delta percentage and discriminating eval count and does not auto-update.
  • When adding a new skill to README.md, add an Eval cost bullet to its Skill Notes section: - **Eval cost**: +X seconds, +N tokens over baseline ([details](evals/<skill>/benchmark.md)). Spell out "seconds" (not "s"). If time/token stats are sparse (e.g. most runs use simulated transcripts), add a caveat. Source values from the Summary table in the skill's benchmark.md.
  • Spawn eval subagents with mode: "auto" to suppress per-tool approval prompts. Default permission mode causes interruptions that slow down parallel eval runs and can break the workflow.
  • After creating a PR, check which skills were modified and whether the changes affect eval-relevant behavior (workflow steps, decision logic, command sequences, assertion-tested output). If so, recommend the user run evals for those skills before merging. If the changes are documentation-only, cosmetic, or don't affect behavior tested by evals (e.g. adding notes, security guidance, or comments), note that re-running evals is not needed and explain why.
  • eval_name must be present for ALL runs in benchmark.json, not just newly added ones. When adding runs for new evals, backfill eval_name for any existing runs that lack it — a partial population breaks schema uniformity with the ship-it format.
  • Use null (not 0 or 0.0) in benchmark.json for unrecorded run stats: tokens: null when token count wasn't recorded and time_seconds: null when elapsed time wasn't recorded. Those fields currently feed run_summary, so 0 and 0.0 would be treated as measured zeros and skew mean/stddev aggregates. Treat tool_calls and errors as optional per-run metadata: use tool_calls: null or errors: null only when those counts are truly unknown or weren't observed, and keep 0 when zero was actually measured. When updating or adding runs, backfill any existing tokens: 0, time_seconds: 0.0, tool_calls: 0, or errors: 0 entries to null only when they represent unknown measurements rather than observed zero values.
  • When adding new runs or re-running existing evals in benchmark.json, also update metadata.evals_run (append any new eval ID) and metadata.skill_version to match the current skill version — easy to miss when adding a single targeted eval or updating existing run entries rather than re-running the full suite. Exception: for validation-only runs (e.g. full-suite regression checks before/after a refactor), do not record new run entries and do not update metadata.skill_version — the version should reflect the skill version under which actual run entries were produced. If all recorded runs are from v1.X but the skill advances to v1.Y without new runs, keep skill_version at "1.X" and add a prose note in benchmark.md explaining the validation history.
  • When prompting the grader subagent, pass the full assertion text strings from evals.json explicitly in the prompt — otherwise the grader uses assertion IDs as the text field in grading.json (e.g. "skips-previously-replied-thread" instead of the full sentence), which breaks alignment with the eval viewer. Do not pass assertion text to the executor subagent (see the executor bullet below) — it contaminates baseline behavior.
  • Non-discriminating evals (both configurations score 100%) are expected when the scenario makes the correct behavior explicit enough for the baseline to handle it. Document them with a note in benchmark.json — they establish a baseline but don't contribute to the delta. Evals with a partial delta (e.g. 80% without-skill) are nearly non-discriminating — do not group them with fully non-discriminating evals; the distinction affects both the problem-statement percentage and the discriminating-evals count in the impact table.
  • Before proposing to add an assertion to an eval, check whether it already exists: rg '"id":.*<keyword>' evals/<skill>/evals.json. A proposed assertion that duplicates an existing one produces a no-op task and inflates the spec scope.
  • When adding supplementary regression runs (run_number > 1 for specific evals): add a regression_run_evals field to metadata listing which eval IDs have supplementary runs, scope token stats notes to "primary (run_number=1) runs", and update benchmark.md accordingly. Keep runs_per_configuration equal to the primary suite's value — do not bump it to the max run_number, which would misrepresent evals that only have one run.
  • For structural refactors that move logic to a reference file (no behavioral change), run only the evals that exercise the moved logic rather than the full suite. Get the old-skill baseline via git show HEAD:skills/<name>/SKILL.md > "${TMPDIR:-/private/tmp}/<name>-snapshot.md".
  • When adding new evals to evals.json, run them immediately — do not wait for the user to ask. Spawn with_skill and without_skill subagents, grade the results, and update benchmark.json as part of the same task.
  • When evals are listed in a spec's tasks.md or plan, run them without asking — inclusion in the plan/tasks constitutes prior approval. Do not prompt "should I run evals?" or wait for explicit instruction; proceed directly to spawning eval subagents, grading, and updating benchmark.json.
  • When a grader flags a missing assertion, add it to evals.json and re-grade the existing transcript — no need to re-spawn the executor if the transcript is detailed enough to provide evidence.
  • When changing pass/fail verdicts on existing benchmark expectations, re-run the eval rather than re-grading with hypothetical reasoning ("General assistant would..."). Hypothetical re-grades can describe fundamentally different behavior from what was originally observed and produce the right pass rate for the wrong reasons. The same requirement applies when adding a new assertion to an existing run entry — evidence must come from an observed transcript, not inferred reasoning (e.g. "baseline would naturally..."). Spawn a fresh executor run to get real evidence. Re-running is also required when an assertion's criterion is tightened (e.g., "first-line match" → "entire-response match"), not only when semantics invert — the agent's output under the tighter rule may actually differ.
  • run_summary.delta.pass_rate must use 2-decimal precision (e.g., "+0.68", not "+0.683"). All benchmark files in the repo use this format — extra decimals create inconsistency without adding information since the README percentage is already rounded.
  • run_summary.delta values must be computed from exact (unrounded) run-data means, not from the rounded mean fields stored in run_summary. When stored means are rounded for display, the delta derived from them may differ from the exact delta by a rounding error (e.g., exact means 42.9625 and 45.625 give −2.6625 → "−2.7", while the rounded stored means 43.0 and 45.6 imply −2.6). When the stored means are rounded, add a sentence to benchmark.md after the token-statistics sentence: "Summary-table Delta values are computed from unrounded means, so they may differ slightly from subtracting the displayed rounded means."
  • When a reviewer suggests specific computed values for benchmark.json (mean, stddev, etc.), verify independently using the actual run data — the reviewer may have computed from a different dataset. Always recompute from the runs array rather than copying a suggested number.
  • A convention inferred from sibling files may be drift — verify a reviewer's "other files do X" against the written rule (pr-human-guide's benchmark violates the skill_version rule it seems to demonstrate).
  • run_summary stddev uses sample standard deviation (divide by N−1, not N). The repo convention, as seen in evals/js-deps/benchmark.json, is sample stddev. Population stddev (N denominator) systematically underestimates variance for small run counts (N=3 or N=4). Recompute from the runs array — don't copy a suggested value.
  • When benchmark.json run entries have expectations: null, there is no stored per-assertion pass/fail data. Bot reviewers that claim specific assertions passed or failed are inferring from context — their claims can be wrong. The notes field written at grading time is the only authoritative source for which assertions differentiated. Decline reviewer suggestions that contradict notes.
  • When updating pass_rate, passed, failed, or total in a benchmark.json run entry, also scan both the run-level notes array and the top-level notes array for matching prose counts (e.g. "3/5 (60%)") and update them. Numeric fields and prose strings drift independently — a correct pass_rate with a stale notes string misleads reviewers.
  • When adding version-scoped notes to benchmark.json's top-level notes array, also audit older entries that reference the same eval IDs — they can describe behavior removed in an earlier version (e.g., "eval 2 differentiates via spec mode detection" surviving a spec-mode removal). Stale semantic descriptions contradict newer entries and mislead reviewers. Update or replace them in the same commit.
  • When renaming action labels or vocabulary in a SKILL.md, search the repo for the old term in evals.json assertion text fields, benchmark.json expectation text fields, expected_output strings, spec files, and all CLAUDE.md files (CLAUDE.md, evals/CLAUDE.md, skills/CLAUDE.md) — they don't auto-update. CLAUDE.md files often contain hardcoded step references (e.g. "Step 13 / Step 6c") that must be updated alongside the skill. This applies to any vocabulary change — not just action label renames. Mode/behavior terminology changes (e.g. renaming default mode semantics) also require propagation to evals.json expected_output and prompt strings.
  • When renaming an eval's name field in evals.json, also update eval_name in all matching benchmark.json run entries, any prose mentions of the old name in benchmark.json notes strings, and the corresponding benchmark.md section header (e.g. ### Eval N — \old-name``).
  • When renaming an assertion id in evals.json, also update the assertion text field (not just the id) and replace the matching expectation text string in any existing benchmark.json run entries for that eval — in-place replacement, no new run needed. Exception: if the assertion's pass/fail semantics are inverted (not just renamed — e.g., flipping from "agent waits for confirmation" to "agent applies without confirmation"), the stored passed and evidence values in benchmark.json are wrong under the new criterion and require a re-run, not just a text replacement. Check whether the existing evidence describes the opposite of what the new assertion expects. When semantics are inverted, null ALL result fields — pass_rate, passed, failed, time_seconds, tokens, tool_calls, and errors — not just pass_rate/passed/failed. The measurement fields still feed run_summary aggregates even when pass/fail is null, making perf deltas misleading. After nulling, recompute run_summary excluding those runs from all stat calculations, then update benchmark.md Summary table and README Eval Δ.
  • When a run is excluded from both sides of the paired comparison (e.g. contaminated), null all result fields in BOTH the with_skill and without_skill entries — not just the contaminated side. Leaving one side non-null makes the documented paired-eval count (e.g. "27 paired evals") inconsistent with what mechanical consumers derive from filtering non-null entries. When nulling result fields, also null the passed and evidence fields in the run's expectations array — leaving verdicts set while results are null implies the grading is valid when it is not.
  • When a benchmark.json run entry has null result fields, the corresponding benchmark.md table row must show N/A | — | — in the Pass rate, Passed, and Failed columns — not the original computed values.
  • When adding new evals, also update the token count denominator in benchmark.md — the sentence beginning "Token statistics are computed only over..." contains "N of M" counts referencing the total primary runs per configuration; update M to the new total eval count and the combined count to 2×M. Also check that benchmark.md has a per-eval section for every eval in benchmark.json — sections for new evals must be added, and any existing evals that lack sections should be backfilled at the same time (sections can silently fall behind benchmark.json when evals are added without updating the doc).
  • Before adding evals for a new mode or behavior, scan existing eval assertions for ones that encode the opposite behavior — e.g., if adding evals that assert auto-mode skips confirmation, check whether any existing eval asserts the agent waits for confirmation. Contradictions must be resolved first (assertion renamed or split into mode-specific evals), or the suite will silently contain conflicting expectations that both pass individually but encode contradictory requirements.
  • For conditional rules (if X → do A; if not X → do B), add an eval for each branch — they discriminate on different failure modes. A single eval would not catch both.
  • When specifying discrimination acceptance criteria for new evals, require that each new eval has at least one failing assertion without_skill — not just "some discriminate." "Some discriminate" passes if one eval discriminates and the rest don't; per-eval discrimination is the correct bar.
  • Eval assertions must test user-facing output, not internal signals: if a skill uses an internal return value from a subagent (e.g. NO FINDINGS) and translates it to user-visible text (e.g. 'No issues found.'), the assertion must test the user-visible string — not the internal signal. An assertion testing the internal signal will never catch regressions in the translation/presentation layer.
  • In multi-model benchmarks, literal-string assertions penalize paraphrase-prone models even when behavior is correct (e.g. Opus 4.7 paraphrased "no findings" rather than the literal "No issues found." on copilot-empty-findings). Prefer semantic-equivalence checks.
  • Fixture-based eval prompts must embed the fixture in the prompt field, not expected_output: expected_output is prose describing the expected grading outcome for the eval runner — it is not readable by the executor. Putting fixture CLI/tool responses in expected_output would confuse the executor about what to output, or cause the grader to treat fixture data as the expected result.
  • Eval prompts must not name the skill or say "the user has invoked the X skill" — skill-name leakage in the prompt context reaches the baseline agent, causing it to follow the skill's output format without needing the skill. All evals become non-discriminating and the delta collapses to 0%. Write prompts as natural user requests that don't reference the skill by name (e.g. "Can you add a review guide to PR #42?" not "The user has invoked the pr-human-guide skill on PR #42").
  • Subagent-based eval execution: spawn the executor subagent with mode: "auto". Prompt the executor to mktemp -d a workspace under ${TMPDIR:-/private/tmp}, Write fixtures there, cd in, and forbid reads outside the workspace (including skills/<name>/SKILL.md on without_skill runs). Pass the executor only the eval prompt and fixture/setup instructions — never assertion text. Assertions live with the grader subagent (see the grader-prompting bullet above), which evaluates the transcript and writes grading.json.
  • Fence the executor out of evals/ explicitly — a recursive grep/rg across the repo can return the eval's own expected_output and assertion text, silently contaminating the run. Scope the executor's searches to the skill directory, and audit each transcript for evals/-touching tool calls before trusting its results.
  • Two-turn evals via followup_prompt: if an eval has this field, tell the executor subagent to issue it as a second user message after turn-1 completes and return both SUMMARY_TURN1 / SUMMARY_TURN2. Runners silently skip the follow-up otherwise.
  • When a reviewer flags one per-model benchmark.json entry, rg for the stale substring before committing — the same fix usually applies to other models/runs of the same eval.
  • Eval executor subagents must NOT call Claude Code's Skill tool — both with_skill and without_skill. For with_skill, the executor must follow SKILL.md directly (read it and act); calling Skill delegates to a fresh sub-instance instead, which is not what's being measured. For without_skill, prohibiting SKILL.md reads alone is insufficient — the agent can still register-and-invoke the skill via the Skill tool, contaminating the baseline. Phrase the agent prompt as: "Do NOT call the Skill tool. For with_skill, do the work yourself by reading SKILL.md." Detection signature: TOOLS_USED: Other: Skill (...).
  • Per-run tokens in benchmark.json = input_tokens + output_tokens summed across assistant turns (matches learn/pr-comments/peer-review). Track cache tokens in a separate cache_tokens field — they bill at 0.1× (reads) and 1.25–2× (creation), and folding them in inflates the headline 50–100× without proportional cost.
  • Validate expectation key schema after grading: jq '[.runs[] | .expectations[] | select((. | keys) != ["evidence","passed","text"])] | length' must return 0. Graders drift from {text, passed, evidence} despite explicit prompts — common drifts: description/assertion instead of text, stray id/n fields.
  • Use evals/scripts/extract_subagent_usage.py to backfill per-run usage from subagent JSONL transcripts — implements the tokens (input + output) / cache_tokens (creation + reads) split and emits per-agent JSON. Don't roll your own parser.
  • Before committing a new category of artifact in evals/ (transcripts, scratch scripts, intermediate JSON), survey what parallel skills commit — ls evals/*/. If no other skill keeps that artifact, don't be the first. Fix "dangling reference" findings by removing the reference, not committing the file.
  • All run_summary.delta values are signed strings ("+0.31", "+835") — not numbers. Applies to pass_rate / time_seconds / tokens / cache_tokens. Storing as numbers breaks consumers that expect the documented schema.
  • Commit grading json selectively; don't commit raw transcripts. Other skills (learn / peer-review / ship-it) commit only evals.json + benchmark.{json,md} + fixtures/. pr-comments adds selective grading-eval{N}-{config}.json files only where graders made judgment calls — not the full set. Transcript content goes inline as quoted evidence in benchmark.json.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.