/lastlight:lastlight-evalsfrom Last Light
Scaffolds and runs Last Light EVALS workspaces — executes real workflows against a mocked GitHub and grades them deterministically. Supports adding eval cases from PRs/issues, comparing models on pass rate/cost/latency, and building PR-review datasets.
Ships in Last Light. 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.
lastlight-evals runs Last Light's real production workflows (issue-triage,
build, …) end-to-end against a mocked GitHub, grades the results deterministically
(no LLM-as-judge), and compares models on pass rate, cost, and latency. It's a
thin CLI on top of the lastlight core package (via the lastlight/evals
barrel), so it exercises the same workflows/skills production does. SWE-bench
compatible. Node 24+.
If the user's evals goal is clear, jump to the section. If it's vague ("help me
with the evals", "what can this do?"), ask (AskUserQuestion) which of these
they want, then go:
| Goal | Section |
|---|---|
| Set up an evals workspace (first time) | §2 Scaffold (+ §1 prereqs, §3 providers) |
| Run evals / compare models | §4 Run |
| Look at past runs (no models run) | §4 — lastlight-evals serve |
| Author one case from a GitHub PR or issue | §6 |
| Build a PR-review dataset from my own gold PRs | §6 → "Build a PR-review dataset" |
| Add cases by hand / understand the schema | §5 + references/instance-schema.md |
| Iteratively improve the score toward a target | the lastlight-evals-loop skill |
New to the whole plugin (server / overlay / client, not just evals)? That's the
lastlight-guide skill — this one is evals-only.
node --version # need >= 24
command -v lastlight-evals >/dev/null && echo "installed" || npm i -g lastlight-evals
lastlight-evals --version # prints the evals version + the bundled lastlight core version
# Optional: for `--sandbox gondolin` (isolate the agent in a QEMU micro-VM so it
# can't read host gold data) you also need QEMU natively: `brew install qemu`
# (macOS) or your distro's `qemu-system` package. The default `--sandbox none`
# needs nothing extra.
init is non-interactive when there's no TTY (piped/agent/CI) — it never
blocks on a prompt. Two layouts:
If you already have a deployment overlay repo (e.g. your-org/lastlight-instance),
this is the default. It runs your real overlay (its config, workflows, skills,
persona) and keeps the eval datasets out of your deployment repo:
lastlight-evals init my-evals --clone your-org/lastlight-instance
cd my-evals && lastlight-evals run # bare run — overlay + datasets auto-detected
This produces:
instance/ — your overlay, cloned as its own git checkout (git-ignored
here; cd instance && git pull to update it)evals/datasets/ — seeded from the built-in triage + code-fix samples (this
is what you edit; always created from defaults at init)evals/models.json — a copy of the built-in model registry.gitignore (ignores instance/ + eval-results/), README.mdThe runner auto-detects ./instance as the overlay and ./evals/datasets as
the dataset root, so a bare lastlight-evals run "just works" — no --overlay flag.
Re-running init --clone is idempotent: it won't re-clone an existing instance/.
lastlight-evals init my-evals # or: lastlight-evals init (→ ./lastlight-evals-workspace)
The workspace is its own overlay: it gets workflows/, skills/,
agent-context/ placeholders + its own config.yaml alongside evals/. Run it
with --overlay .. In a TTY it offers git init + a private gh repo create
(--no-git to skip, --yes to take the non-interactive path).
.env)Create .env in the workspace with at least one provider key. GitHub is
mocked end-to-end, so no real GitHub token is needed (the harness sets a
dummy one internally).
# any one (or more) of:
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
FIREWORKS_API_KEY=fw-...
OPENROUTER_API_KEY=sk-or-...
DEEPSEEK_API_KEY=...
Useful optional vars: EVAL_MODELS (comma-list override), LASTLIGHT_EVALS_OUT
(scorecard dir, default ./eval-results/), LASTLIGHT_CORE_DIR (point at a local
lastlight checkout to eval un-published asset edits), CI=1 (don't open a
browser). See references/models-json.md for the model registry format and
how --compare is key-gated.
From inside the workspace. For the Separate layout the overlay (./instance)
and datasets (./evals/datasets) are auto-detected — no --overlay needed. For
the Plain layout pass --overlay ..
cd my-evals
lastlight-evals run # default model, triage tier (auto overlay+datasets)
lastlight-evals run triage # one tier
lastlight-evals run triage code-fix # multiple tiers
lastlight-evals run triage --model haiku # fuzzy match in models.json
lastlight-evals run triage --model openai/gpt-5.5,anthropic/claude-opus-4-8
lastlight-evals run --compare # cross-vendor set (only models whose envKey is present)
lastlight-evals run triage --runs 3 # repeat each CASE 3× (folded into one worst-case verdict, mean metrics)
lastlight-evals run pr-review --repeats 3 # repeat the whole ARM 3× → 3 sibling runs, read as a BAND (see below)
lastlight-evals run pr-review --limit 3 # only the first 3 cases of the tier (controlled/cheap run)
lastlight-evals run triage --instance <id[,id2]> # only these exact instance_id(s), comma-separated (or set EVAL_INSTANCE)
lastlight-evals run pr-review --f-beta 0.5 # pr-review F-beta β (default 1=F1; 0.5=precision 2×). Or EVAL_F_BETA
lastlight-evals run pr-review --judge-with-diff # feed the PR diff to the judge (higher fidelity; off by default)
lastlight-evals run pr-review --no-inject-context # DON'T inject synthetic repo-context into the checkout (clean A/B control)
lastlight-evals run pr-review --sandbox gondolin # isolate the agent's tools in a QEMU micro-VM (anti-spoil). Or EVAL_SANDBOX
lastlight-evals run pr-review --keep-workspace # don't delete each trial's workspace (inspect .lastlight/ artifacts afterwards). Costs disk
lastlight-evals run pr-review --concurrency 4 # run 4 cases of the SAME arm at once (default 1=serial). Arms stay serial; forced to 1 on --sandbox gondolin
lastlight-evals run triage --no-open # don't open the report
# Plain layout: add --overlay . (e.g. lastlight-evals run triage --overlay .)
lastlight-evals serve # browse past runs in the dashboard (no models run)
lastlight-evals clean --dry-run # list killed/crashed runs that are stuck "running"
lastlight-evals clean # finalize them (mark interrupted; --delete to remove)
--repeats N — never report one arm as a numberOne run of an arm is not a measurement of that arm. Three identical runs of
one pr-review arm scored micro-recall 0.320 / 0.080 / 0.200; diff-runs returned
KEEP on one and REVERT on the other two, from one configuration. Union across the
three was 0.440 and intersection 0.040 — only 1 gold finding in 25 was found by
all three.
--repeats N runs the whole arm N times, sequentially by default
(--repeat-concurrency M overlaps up to M repeats at once — recall/cost are
unaffected, but per-phase latency contends and each repeat stamps
meta.repeat.concurrency so timing reads can be discounted), and writes N
sibling runs (each its own runId/scorecard.json, tagged
meta.repeat = {group, index, of} where group is the first repeat's runId).
Report the band (min–max), not a point. It implies --keep-workspace (you will
need each repeat's evidence when they disagree) and --no-open (a run holds its
dashboard server open until killed — N of those leak); it prints the standalone
serve command instead. Compose with --runs if you want both axes; they are
different things — --runs folds trials into one result and destroys the
per-trial detail a band is computed from.
Before reading any delta as progress, get the two error bars:
lastlight-evals run pr-review --repeats 3 # the ARM's own band
npx tsx scripts/band.ts <run1> <run2> <run3> # read it: mean/band + union & intersection recall (free)
npx tsx scripts/rescore.ts <scorecard.json> --repeat-judge 3 # the GRADER's band (SPENDS MONEY)
scripts/band.ts is the read-only way to see a band without the dashboard: per-repeat points, mean/min/max, the band (null below two repeats — one run cannot bound its own noise), union and intersection recall, the per-gold hit matrix, and any case it could not align, by name. Pass the repeats' run dirs (or scorecard.json paths) explicitly — it never infers which runs form an arm, because same tier + same arm label + same case set also describes a completely different configuration. --vs <runs…> adds a second arm and a band-first KEEP/REVERT/INDISTINGUISHABLE verdict.
scripts/rescore.ts --repeat-judge N re-runs the LLM judge N times over a stored
scorecard's review text + gold set and reports the spread, which separates grader
noise from pipeline noise (matching is entirely LLM-judged, and judge/developer
agreement is only 0.44–0.62). It is the one rescore mode that costs money — 2
judge calls per case per repeat — so it never runs by default, prints its
estimate first, and refuses --write. A candidate's Δ has to clear both
bands to mean anything.
Each run lands in its own dir ./eval-results/<tiers>/<runId>/: scorecard.json
predictions.jsonl (SWE-bench format). The report is a JSON-driven dashboard
SPA, not generated HTML — run starts a local server and opens it; browse every
past run later with lastlight-evals serve. In the dashboard a code-fix row's
files button opens the agent's captured diff and log shows the per-phase
agent session.If a run is killed or crashes mid-flight it stays stuck showing "running" (its
scorecard never got its final write). lastlight-evals clean finalizes such runs
— marks them interrupted (default; keeps the partial scorecard + transcripts)
or --delete removes the run dir.
Six tiers ship: triage (cheap, issue-triage), code-fix (heavy, build
workflow with held-out tests), pr-review (PR-review precision, graded by
an LLM judge against a gold set → precision / recall / F1 by default, the
F-beta configurable via EVAL_F_BETA), repo-config (a repo's committed
.lastlight/ layer), fix (the diagnosis half of the fix loop — one case per
diagnosis class), and dependency-merge (a major bump per impact tier, which
measures the one policy the code deliberately does not enforce). To add cases or
a custom tier, read references/instance-schema.md — it has the
SweBenchInstance schema, the exact files to create for each tier, and worked
examples.
Quick shape (paths are relative to the workspace's evals/ dir):
SweBenchInstance to evals/datasets/triage/instances.json
with issue, triage_gold, and expect_github.evals/datasets/code-fix/instances.json and
create evals/datasets/code-fix/repos/<instance_id>/ (fixture repo at base) +
evals/datasets/code-fix/tests/<instance_id>/ (held-out tests applied at grade time).SweBenchInstance with a pr fixture (base/head refs +
commits, checked out at the PR head) and a review_gold set (severity +
description). Populate the full Martian
Code Review Bench 50 with
npx tsx scripts/import-martian.ts, or author your own gold-PR dataset
with add-case --pr <url> --review (see §6 and
references/authoring-pr-review.md). Grading needs a judge model
(EVAL_JUDGE_MODEL, else a strong default per provider key).
AGENTS.md/CLAUDE.md into the checked-out repo so the reviewing agent reads
it — a generic block from <overlay>/repo-context/AGENTS.md (every repo)
plus a per-repo block from datasets/pr-review/context/<instance_id>/AGENTS.md.
Presence-based (just create the file), on by default; --no-inject-context
(or EVAL_INJECT_CONTEXT=0) forces a clean control for an A/B. It appends to
a real AGENTS.md/CLAUDE.md if the repo ships one (never shadowing it). This
is how you prove "adding this to your repo improves review quality" — and the
lever the lastlight-evals-loop skill drives.pr seed, a pr_state block (the snapshot a
dispatch would have resolved — it is what supplies {{ciSection}},
{{attempt}}, {{mayMerge}}) and an expect_markers verdict. A fix case
that needs a checkout also needs repos-head/<id>/, the PR's own commit on top
of the base tree.evals/datasets/<tier>/ with tier.json +
instances.json (+ repos/ & tests/ for code-fix-style tiers). Discovery is
automatic — no code change.When the user says "create an eval dataset/case from this PR/issue " or
"create a PR-review eval dataset from these gold PRs", use the add-case
subcommand — it does the mechanical extraction; you refine the fuzzy parts.
A PR seeds two different evals, so --pr requires a kind — --review (the PR's
human review is the gold set) or --code-fix (hide the fix, the agent must
reproduce it):
lastlight-evals add-case --pr <github-pr-url> --review --dry-run # propose a pr-review case; don't write
lastlight-evals add-case --pr <github-pr-url> --review # write into ./datasets/pr-review (or --overlay)
lastlight-evals add-case --pr <github-pr-url> --code-fix --dry-run # propose a code-fix case
lastlight-evals add-case --issue <github-issue-url> --dry-run # propose a triage case
pr fixture (base/head refs + commits,
from the PR's baseRefOid/headRefOid) and a candidate review_gold from
the PR's human review — inline comments + substantive review bodies, with
bot/nit/reply/outdated noise filtered out. Prints an evidence block; you
assign real severities and prune non-actionable comments. Byte-compatible with
import-martian.ts, so authored cases sit alongside imported ones. Leak-safe:
the review lands only in review_gold, never in the seeded PR the agent sees.repo, base_commit (merge-base of base &
head) + head_commit, the PR's test diff as the held-out test_patch, and
auto-detects FAIL_TO_PASS / PASS_TO_PASS by running the tests at base (red)
vs head (green). Produces a git-source case (no repos/<id>/ vendored): at
run time the harness clones the repo into the gitignored ./.eval-cache/ and
checks out base_commit.issue seed + problem_statement, the
labels that were applied (from the issue events API, with who applied each)
→ expect_github.labels_added, issue_closed if it was closed, and prints the
reviewer comments — the raw triage signal. You then assign
triage_gold (category/state) from those labels per the deployment's taxonomy.When the user says "I want to create a PR-review eval dataset" (from their PRs, to track review quality as they evolve models/prompts):
./datasets (or --overlay <dir> for a deployment's own dataset).add-case --pr <url> --review --dry-run, read the evidence block, then
curate the candidate review_gold — set real severities and drop
comments that aren't concrete findings — and write it
(add-case --pr <url> --review [--datasets/--overlay …]). Re-running the same
PR replaces by id, so curation is idempotent.
lastlight-evals run pr-review --limit 1 --model haiku.See references/authoring-pr-review.md for the full extract→curate→write
flow, the --severity / --include-bots knobs, and the anti-spoil guarantee.
The full flow, what you refine for each, the test_cmd / setup_cmd options for
non-node --test runners, and the trust/offline caveats are in
references/authoring-from-pr.md (PR code-fix + issue triage) and
references/authoring-pr-review.md (PR review) — read the relevant one
before authoring.
The workspace is scaffolded (Separate: overlay in instance/, evals at root;
Plain: self-overlay), .env has a working provider key, and a bare
lastlight-evals run produces a scorecard under eval-results/. Report the
workspace path, the layout used, the provider(s) configured, and the run/compare
command.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub nearform/lastlight --plugin lastlight7 skills in this plugin
/lastlight-clientInstall the `lastlight` CLI and connect it as a CLIENT to an existing Last Light server — log in, save the token, and verify the connection. Use when the user wants to "connect / point my lastlight CLI at a server", "log in to Last Light", "set up the lastlight client", or run lastlight commands against a remote instance. For standing up the server itself use lastlight-server; for editing a deployment's config use lastlight-overlay./lastlight-debugDebug a running Last Light instance over its admin API with the `lastlight` CLI — no SSH. Use when the user wants to "look at / debug a failed or stuck workflow", "why didn't the bot do X", "check a bad agent run / phase error on <instance>", "tail a session", "search the logs", "read the server/docker logs", "list/trigger a cron", "resolve an approval", or "check stats/cost" against a deployed server. Needs a CLI already connected (see lastlight-client to log in). For standing up the server use lastlight-server; for editing config/workflows use lastlight-overlay./lastlight-evals-loopDrive a Last Light EVAL toward a target score with a disciplined, anti-gaming improvement loop — run → mine failures → propose candidate fix(es) → re-measure → keep the best or revert → repeat. Use when the user wants to "improve / raise the pr-review F1", "make the reviewer better against the eval", "close the loop on evals", "iterate on prompts/skills to pass more cases", or "tune the workflow to hit a score target". The loop diagnoses on a TRAIN split and validates on a BLIND held-out split so fixes must generalize, not overfit; it prefers generic overlay prompt/skill edits, and stops for human sign-off before editing any gold answer. For a one-off run/compare use lastlight-evals; to hand-fork a workflow/prompt use lastlight-overlay. Needs an already-scaffolded evals workspace (lastlight-evals) with a pr-review dataset./lastlight-guideOrientation & router for the Last Light skills. Use ONLY when the user has NOT named a concrete Last Light task — i.e. they're unsure which skill/flow they need, ask "what can Last Light do / where do I start", say "help me with Last Light" with no specific goal, or want a guided tour across server / client / overlay / debug / evals. Do NOT use when the ask already names a task — "set up/deploy a server" → lastlight-server, "connect/log in my CLI" → lastlight-client, "customize a workflow/prompt/persona/config" → lastlight-overlay, "debug a failed/stuck workflow or run on an instance" → lastlight-debug, "run evals / compare models / author a case / build a PR-review dataset" → lastlight-evals, "iteratively improve an eval toward a target score" → lastlight-evals-loop: invoke that skill directly. This skill only routes and, when the goal is ambiguous, asks. Also invocable as /lastlight-guide./lastlight-overlayCreate or customize a Last Light deployment OVERLAY (the private instance/ repo) — scaffold it, then fork built-in workflows, prompts, skills, or the agent persona (agent-context) so a deployment can override them. Use when the user wants to "create a Last Light overlay / instance repo", "customize / fork a workflow", "override a prompt or skill", "change the agent's persona/soul/rules", or tune a deployment's config without forking the whole codebase. For first-time server install use lastlight-server./lastlight-serverInstall and configure a Last Light SERVER — the GitHub maintenance agent plus its docker-compose stack — on a host. Use when the user wants to "set up / install / deploy / stand up a Last Light server or instance", configure its GitHub App, models, managed repos, or domain, or get the agent running for the first time. Drives the `lastlight` CLI; for connecting an existing CLI to a server use lastlight-client instead, and for editing a running deployment's config use lastlight-overlay.Other plugins' skills for the same job