Every recent ci-red in my self-improve lane came from the runner, not the proposed fixes: launchd's python3 had no PyYAML. I removed the dependency and made a red base CI end the run without charging the candidate an attempt.
My self-improve lane kept ending its apply step in ci-red, and the cause turned out to be the runner. I moved frontmatter reading to the standard library and changed the CI gate so that a run where the base CI is already red no longer uses up a candidate's attempt.
self-improve collects tool errors and corrections from my session transcripts, groups them into daily signatures, and has a model propose one-line improvements that pass through gates and merge on their own. launchd runs self-improve.py run every day at 10:00. When I went through the record, the apply step had never once managed to merge anything.
What was going wrong?
Apply had been tried six times, with zero merges. The last four all ended in ci-red. My first assumption was that the proposed fixes were breaking CI, but the log from the rest group of the 2026-11-09 apply said otherwise:
ModuleNotFoundError: No module named 'yaml'
That error had nothing to do with the change under test. The python3 that launchd uses had no PyYAML, so both copies of measure-context.py died at import. When I ran CI from my terminal, Homebrew Python came first on the path, and it did have PyYAML, so every time I checked by hand the failure stayed hidden.
Worse, each red run charged that run's candidate one attempt. The ledger for that day held two candidates, both aimed at the worktree isolation guard, marked gave-up. While the runner was broken, candidates that may have been fine were being used up one by one.
How did I decide to fix it?
The fastest option was to install PyYAML into launchd's Python. That would fix this one machine and leave an undeclared dependency in place, and the next time the lane ran somewhere else the same thing would happen. I didn't take it.
The second option was to classify ModuleNotFoundError alone as ci-env, so it would not count against the candidate. That only covers this one symptom. If the runner broke in some other way, it would go back to burning candidates.
I decided to do both things at once: remove the dependency, and protect candidates whenever the runner is broken.
What did I change?
First, I wrote claude/tools/skill_front.py, a frontmatter reader that uses only the standard library, and switched both measure-context.py scripts from PyYAML to it. Skill and agent frontmatter has a simple shape, so full YAML isn't needed. A reader that silently returned a wrong value would skew the context budget measurement, though, so it fails on any shape it can't read. To check it, I read 100 skills and agents both ways and compared them: zero differences.
Second, I changed the CI gate in self-improve.py. When CI goes red, it runs again without the fix. If CI is still red with no fix applied, the base is broken and the candidate isn't to blame, so the run ends as base-red and the candidate keeps its attempt.
Third, claude/docs/LANES.md still described self-improve as run by hand, even though its plist was already registered and running daily at 10:00. I updated the doc to match the real schedule. A CHANGELOG entry and three tests went in with it.
How did I check it?
I had to run CI under the same python3 launchd uses. Running it from the terminal as usual would pick up Homebrew Python and miss the problem the same way I had missed it before.
PATH="/usr/local/bin:$PATH" bash .github/ci/run.sh all
Run that way, all seven CI groups passed, and test-self-improve.sh all passed 231 tests. The work took two sessions: 01-plan set up the plan, simplify cleaned it up, and ship opened the PR. The change was 118 lines added and 15 removed, and it cost about $3.2, almost all of it on Opus 5.5.
What is still open?
On November 13, the lane carried two candidates all the way through and merged them as #298 and #299, so the blocked path was open again. Eight days later, though, the judge found that the signals both candidates targeted had gone up: the per-session rate went from 3.5% to 7.0% for one and from 5.2% to 13.2% for the other. The lane tried to revert both and stopped on a revert conflict and a failed git fetch. I fixed those separately in #360 and #367.
I chose not to revive the two candidates already marked gave-up. I didn't edit the ledger by hand; I left their signatures open, so propose can suggest them again if the evidence is still there.
The lesson for me is that a passing run in my terminal says nothing about what an automated lane will see. And a gate that fails without checking whether the base or the candidate caused the failure will keep using up candidates for problems they didn't cause.
Build stats
| Model | Input | Output | Cache read | Cache write | USD |
|---|---|---|---|---|---|
| claude-opus-5-5 | 72 | 45,105 | 6,050,511 | 137,892 | $3.22 |
| claude-sonnet-5-5 | 4 | 732 | 11,725 | 18,030 | $0.05 |
| Total | 76 | 45,837 | 6,062,236 | 155,922 | $3.27 |
Counted from 2 session transcripts at 2026-11-17T01:34Z (PR #251, sessions 2026-11-09 to 2026-11-09). Tokens include subagents; USD is list price. Code: +118 / −15 lines.