Artifact 849332a79ccc06216f2c5907c6220db02d01512e7019f4dd095410d1af26e125:
- File eval/README.md — part of check-in [936b9f1c41] at 2026-11-13 14:20:43 on branch mcp — Add ctx mcp: search and turn as tools for clients that cannot run commands, with a benchmark showing it level with the skill (user: dmestas, size: 3623) [annotate] [blame] [check-ins using] [more...]
Skill eval
Measures skill/ctx/SKILL.md against questions about past work, so changes to
the skill are judged by results. Needs claude and a real archive. Run it by
hand; CI only tests the harness, with a stand-in for the model.
Questions come from private sessions, so the bank and every result stay in
~/.ctx/eval, which only you can read. Nothing from there goes in this repo.
The loop
- Find what to fix.
eval/skill_eval.py usagereads how agents really usedctx: commands that do not exist, searches with no matches, overlong queries. Note anything worth fixing. - Turn a real failure into a question when you can, by running
authorfor that project. - Change the skill and iterate on the dev set:
run --set dev,grade,report. - Gate it on the held-out set, using the old and new skill files:
eval/skill_eval.py run --set holdout --skill OLD.md --name old
eval/skill_eval.py run --set holdout --name new
eval/skill_eval.py compare ~/.ctx/eval/runs/old ~/.ctx/eval/runs/new
compare exits 1 if the score drops, wrong answers rise, or new tokens rise
more than 15%. Land the change only if it passes, and do not edit the skill
to fit a held-out question: that spends the held-out set.
A question's set comes from a hash of its id, one in three held out, so new questions need no bookkeeping.
What keeps it honest
- Each answer is a fresh headless process with hooks and session saving off, so runs cannot see each other or end up in the archive.
- The code and the archive are frozen copies, removed afterwards.
- Conditions: A the repo only, B grep over transcripts, C the skill.
Only C has
ctxor the skill. The skill is never mentioned in the prompt, soreportalso shows how often agents reach for it. run --ask plainasks the bare question, with no mention of past work or sources, so a run shows whether the agent reaches forctxunprompted. The default,teammate, frames it as a question about past work.comparerefuses runs with different--askvalues. Condition B still lists its transcript folders in the prompt.- Condition M offers ctx only as a Model Context Protocol server:
ctx mcpwith its two tools and a one-sentence note, with no skill and noctxcommand. Its tool calls count as reaching ctx. - Condition J is H plus what the UserPromptSubmit injection hook would add, joined into one note.
- Condition R is C plus what the UserPromptSubmit recall hook would add: it
runs
ctx recallon the question text and appends the output to the system prompt. I and H are the same idea withctx injectand the SessionStart hook. run --kind KIND[,KIND]keeps only questions of those kinds. Questions of kindcodecan be answered from the code alone, so anyctxuse on them is a false reach.- Reach is the share of runs with at least one
ctxcall.reportprints it per condition and, for I, H and R, how many runs had text injected and how many of those reachedctx.compareprints old and new reach; the gate does not use it. - Runs that reached session history they should not have are voided.
comparegrades both runs in one shuffled pass with sources masked.authordrafts questions, then a separate review pass checks each against the sessions and the code, and fixes or removes it.
Adding a project
eval/skill_eval.py author --project NAME --repo PATH [--sessions PATH]
NAME is what ctx calls the project. --sessions is where sessions ran, if
--repo is a copy elsewhere.