CRUCIBLE: One Idea In, Working Repo Out
One Idea In, Working Repo Out
Claude Code in a loop that can't grade its own homework. Several builders race the same idea in isolated git worktrees, pytest and ruff judge every attempt, a critic that never saw the build scores it, and plain Python decides when it's actually done.

- Year
- Oct 2026
- Timeline
- v1 Jul 2026 · v2.1 Oct 2026
- Type
- AI
- Status
- Live
13 defects
Blocking defects the critic found in round 1 of the recorded live run, on code that had already passed pytest and ruff. Round 2 fixed them and the score went from 3/10 to 6/10.
Overview
Ask a model whether its own code is good and it will tell you yes, because it grades in the same context that produced the work. So you become the loop: pasting tracebacks back in, eyeballing diffs, deciding on no particular basis that this version is probably fine, then finding out two versions ago was better and you didn't keep it. CRUCIBLE takes three decisions away from the model. Tests and lint decide whether the code runs, a separate session with read-only tools and no memory of the build decides whether it's any good, and rules in plain Python decide when to stop.
The hard parts
- 01
A model reviewing its own output gets agreeable, so the reviewer had to be a stranger to the build.
- 02
Independent samples of one prompt cluster around the same answer, so best-of-N buys little unless the attempts really differ.
- 03
The logic worth testing decides which of several model outputs wins, and that can't be asserted against a real model.
- 04
Builders run unattended with permission prompts off, which is only safe if they can never touch a repo that matters.
The approach
Every round is a tournament. N builders fork from trunk into their own git worktrees and work in parallel, each under a different emphasis (read the idea straight, the simplest design, robustness), so the field has something real to choose between. Only candidates that pass pytest and ruff, run by the controller and never by a model, reach the critic: a separate claude -p session with read-only tools, a stronger model than the builders, and a verdict enforced by --json-schema, so there is no parsing and no retry loop. A round scores the minimum of five rubric dimensions, so brilliant code with hollow tests can't pass, and vacuous tests cap the test-quality score. The winner fast-forwards onto trunk and gets a tag. Losers survive as branches, because the rejected approach is often the more interesting diff. Stopping is a rule, first match wins: pass, round cap, stall or budget.
Outcome
In the recorded run against the real CLI, round 1 passed both gates and the critic still returned 13 blocking defects, including an amount check that let NaN and Infinity through and a save that could wipe the file on a crash. Round 2 fixed them and grew the suite from 14 to 26 tests. The run stopped on its $3 budget, and git checkout best gives 40 passing tests. Version 2.1 added --demo, a whole tournament offline against a scripted claude with real worktrees and real gates, and a single-file HTML report with score progression, cost against the budget and every candidate's rubric scores.
What I'd do differently
The fake CLI taught me the most. An early version only checked that --json-schema was present, so the suite stayed green while every real critic call would have failed: the flag takes the schema inline, not a file path. Now the fake enforces the real contract and a test pins it. Next on my list are a varying field size per round, a critic ensemble for close calls, and a hard per-call budget instead of a check after each round.
Stack
Like what you see?
Let's build the next one.
Hiring, or have a problem that needs this kind of engineering? I read every message myself.
