Files in directory /eval from the latest check-in
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. - A project in the bank may list
docs: folders, relative to its repo, that are indexed withctx docs addfor every condition that has ctx. Condition N is C plus a one-sentence note that the repository's documents are indexed. - Condition P is H plus a command run after every Grep or Bash call, as a
PostToolUse hook would be; the command comes from
SKILL_EVAL_POSTTOOL. - Condition Q is the repo alone with
ctxon the PATH, no skill and no note, plus the same command as P: what a hook does for an agent that was told nothing. - Condition G is the repo alone with
ctxon the PATH, plus a command run before every Grep, Glob or Bash call, as a PreToolUse hook would be; the command comes fromSKILL_EVAL_PRETOOLand may turn a call back. - 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.