/evals-from-sessions:evals-from-sessionsfrom evals-from-sessions
Converts coding-agent session exports (Claude Code, Codex, Gemini CLI, etc.) into Harbor eval tasks. Covers episode selection, task creation, verifier writing, validation, and smoke testing for personal benchmarks.
Ships in evals-from-sessions. 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.
Goal: for each selected trajectory, produce one Harbor task directory that meets Done (bottom). Stop after the smoke run (or after the optional calibration in step 8). Model comparisons and leaderboards are out of scope.
Harbor layout, paths, network and commands: references/harbor-contract.md. Starting files: assets/task-template/. Leak probe: assets/leak-probe.sh.
Difficulty is a label, not a reason to reject. Record it in candidates.md,
task.toml ([metadata] difficulty) and report.md.
Reject only trivial episodes: one command typed from the instruction alone reaches the end state, or the task reduces to knowing one flag.
tests/test.sh
downloads nothing. Fixtures are fixed files or use fixed seeds and timestamps.COPY tests/, solution/ or hidden fixtures into the
image.network_mode = "allowlist" (see contract) or reject the episode./tmp. Never delete job directories
or earlier task versions.provenance.md holds source paths and names. It never goes
into the image or a published copy; leak checks cover every other task file.candidates.md and provenance.md, not turn numbers.jq, head or a one-liner.Copy the sessions into a working directory and work only on the copy. Usual locations:
| Agent | Sessions |
|---|---|
| Claude Code | ~/.claude/projects/<project>/<session>.jsonl |
| Codex CLI | ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl |
| Pi | ~/.pi/agent/sessions/ |
| Gemini CLI | ~/.gemini/tmp/<hash>/chats/ |
Some agents delete old sessions (Claude Code after 30 days by default,
cleanupPeriodDays), so copy early.
Run gitleaks dir <copy> --redact --no-banner --report-path <workdir>/gitleaks.json
and record the number of hits in candidates.md. Never write a secret anywhere.
Skip subagent files (<session>/subagents/, reviewer or guardian runs): they have no
user request or correction.
Check harbor --version and record it in report.md. The contract shows Harbor 0.24
syntax. Before the first use of each command, confirm its flags with --help on the
installed version, and take schema_version from the skeleton that harbor task init
creates. If a command does not exist in your version (for example harbor check),
record "not available" in report.md and continue.
Skim each session: every user request, later corrections, final files, commits and
commands, how it ended. Write candidates.md with one row per substantive request
(non-coding requests go into one summary line):
| session | lines | user_goal | decisive_correction | outcome | mode | decision / reason |
|---|
Keep an episode only if all hold:
Reject open-ended research without a checkable conclusion, taste-only UI work, pure
live-infrastructure operations, and episodes whose only success signal was "the user
said OK". Prefer episodes with a decisive user correction or a real failure of the
source agent. Label each kept episode discovery or routine (see Difficulty) in the
decision column. If no episode passes, say so and stop; do not lower the bar.
Mode. Use private if the source repository is available locally and the episode
ended in an identifiable commit or a clean diff. Otherwise use shareable, or reject.
Checkpoint 1 (see below) after candidates.md.
Write <task>/provenance.md before any other task file (it is never copied into the
image): source session, path and JSONL lines; mode; for private mode the repository, parent
commit and episode commit; requirements (3–8 bullets "the solution must ...");
failure modes (source agent mistakes, user corrections, edge cases the user stated;
each stays observable and each must be caught by a check); the must be discovered
list.
Must be discovered. Conclusions the agent reaches only by combining evidence from
the repository or data. Documented API rules, explicit user constraints, the choice
of a standard command, and outputs of a formula or decision tree given to the agent
do not count. A tie-break or convention the source agent chose, and the user never
confirmed, is reference behavior, never an item. For each item, quote the nearest user
sentence and the evidence lines; drop the item if the sentence states it. Each item
counts only if a near-miss solver that skips it fails (step 6). The list freezes when
Checkpoint 2 is approved; review notes may change it once before that, never after. If it
is empty, the task is routine: keep it and state every rule in the instruction. If a
later fix must state an item in a task file, reject the episode. Every explicit user constraint
goes into the instruction; withholding one creates a hidden requirement.
root_cause.Checkpoint 2 after provenance.md.
At each checkpoint stop, print the absolute path of the file, and wait for approval.
If the run is unattended, write AWAITING_REVIEW (one line: the file path) next to the
file and end the run without building the task. Continue only after approval in chat
or an APPROVED file next to it; then delete AWAITING_REVIEW. Apply review notes
once; a second "revise" is a rejection.
Copy assets/task-template/ into the task directory except provenance.md: never
overwrite the approved provenance (rsync -a --exclude provenance.md, or cp -n).
data/") need one (for example an evaluator-owned hash).git archive <parent-commit> of the repository into
environment/repo/; the Dockerfile re-inits it as one commit (template). Move tests
added by the episode commit to tests/ and delete them from environment/. Strip
.env, credentials and private data the task does not need. gitleaks dir environment/ must report zero hits.git diff <parent> <episode-commit> (minus moved tests) as
solution/fix.patch, applied by solve.sh.1.0.0, timeouts, resources; under [metadata]:
source_session, category, mode, difficulty, visibility ("private" in private
mode; "public" for a shareable task you may publish). In shareable mode,
source_session is an opaque label (for example episode-03); the real session id
stays in provenance.md.
Pin the base image tag and language packages; do not pin exact apt versions.Keep the template test.sh: it always writes /logs/verifier/reward.txt. In
tests/verify.py (keep the canary line):
tests/ or come from fixed fixtures;
never from the post-agent state or from files the agent can edit.same(). Use a tolerance for computed
floats. Do not grade formatting the instruction does not fix.PASS/FAIL <reason> line per check. Stdlib only.solution/solve.sh reaches the correct end state legitimately (private: apply
fix.patch). It must not touch /tests or the verifier output.
Keep validation files in <tasks-dir>/../validation/<task-name>/, never inside the
task. Commands are in the contract. Required evidence:
nop fails: -a nop gives 0.0 (starter state).
Oracle passes: one job -a oracle -k 5, all five 1.0.
Mutants fail (mutants/*.sh, each run as solve.sh of a temp copy, all 0.0):
one near-miss per failure mode and per must be discovered item. Each is a coherent
solver that makes exactly that mistake and follows it through, not a one-field flip
of the expected answer. Add visible-only.sh if there is a visible sample.
Alternative correct solution passes (alt-correct.sh, 1.0): a solver that reads
the inputs, written without the reference or the expected fixture, making different
free choices (other valid evidence, structure, default formatting). Never hardcode
the answer.
Leak check: grep the task directory for source strings (paths, hostnames,
usernames, emails, repo names, keys); shareable expects no hits, private expects
only the snapshot itself. gitleaks dir <task>/environment gives zero hits.
Leak probe: run assets/leak-probe.sh <task> <solution-strings.txt> (strings
only the reference diff contains, several per answer value). Expect one commit, one
reflog entry, no remotes, tags or hooks, and zero string hits inside the built image.
harbor check: run it, copy every finding into report.md, and fix or justify
each fail.
Contract audit before the first smoke: re-read the instruction sentence by sentence against the checks; remove or check every normative sentence now.
If any result is wrong, fix the verifier or the instruction, bump version, repeat.
Run one real agent once, with the reasoning effort passed explicitly. The trial must
finish without an exception_info. Classify the result:
tests/; otherwise reject the episode. Never edit the instruction
after the first smoke run. A run can have several classes; record each check.discovery task, note for
each item whether the agent had to find it. If a discovery task passed in fewer
than ~10 tool calls, relabel it routine in task.toml metadata and report.md,
and note why. A routine pass is a valid result, not a defect.After the first smoke run, fix only a reproduced verifier or stand-in defect, and only
in tests/ or the stand-in. If a fix would state a frozen item, reject the episode.
After any fix: bump version, redo step 6, smoke again. At most two version bumps
after the first smoke run; a third means reject.
Optional please-hack smoke: one more run with the prefix template in the contract.
Any 1.0 without a correct end state is a verifier defect.
Run 2 configurations × 3 runs. Flag too-easy if every run passes in fewer than
~15 tool calls. Flag audit if no run passes, and check the task for defects before
keeping it. Record both flags in report.md.
The run always ends by writing report.md, also after a rejection or an error. Never
end the run right after a job finishes. Per task, write <tasks-dir>/../validation/<task-name>/report.md: source session and
JSONL lines; mode; difficulty; checkpoint decisions; the frozen list; a table instruction sentence →
check → separating fixture or mutant; results of nop, oracle ×5, each mutant,
alt-correct, leak check, leak probe, harbor check findings; every smoke run (agent,
model, effort, reward, steps, cost, job path, classification); calibration flags.
discovery or routine); not
trivial; no frozen item stated;0.0; oracle 1.0 ×5; alt-correct 1.0; every mutant 0.0;harbor check findings recorded;Done means ready for human review, not accepted. Reviewer agents and then the user
check the frozen list against the task files and look for hidden requirements before
the task enters the benchmark. Any later material change needs a new version; do not
compare scores across task versions.
assets/leak-probe.sh (opens in a new tab)assets/please-hack.j2 (opens in a new tab)assets/task-template/environment/Dockerfile (opens in a new tab)assets/task-template/environment/repo/README.md (opens in a new tab)assets/task-template/instruction.md (opens in a new tab)assets/task-template/provenance.md (opens in a new tab)assets/task-template/solution/fix.patch (opens in a new tab)assets/task-template/solution/solve.sh (opens in a new tab)assets/task-template/task.toml (opens in a new tab)assets/task-template/tests/test.sh (opens in a new tab)assets/task-template/tests/verify.py (opens in a new tab)references/harbor-contract.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ibragim-bad/evals-from-sessions --plugin evals-from-sessionsOther plugins' skills for the same job