Source: Five months treating bugs like patients and coding agents like a medical team, by Adam Storm and Rafi Shamim
A coding agent can write the wrong fix and still get the tests green. Cockroach Labs ran its agents for five months as a teaching hospital: issues are patients, merging is discharge. Every change passes three gates before it reaches main.
Each role is an agent with its own prompt. The Review Attending is always a different instance from the Fellow who did the work.
Reads the incoming issue, classifies severity and complexity, and admits or rejects it.
Reproduces the bug, narrows the cause, and posts a plan: diagnosis, files to change, tests to add, risks, open questions.
A prompt built to find fault, not to fix. Approves or rejects the plan before any code exists. Rejects under 10% of plans.
Implements the approved plan. If stuck, writes an I-PASS handoff and escalates instead of trying harder.
Starts by disabling the change. Every new test must then fail; a test that still passes is out of scope or wrong.
Does not re-review the code. Audits that the review happened: an approval exists, the template is filled, no unresolved threads, CI is green, history is clean. Posts the checklist.
The patient goes home. A stuck stage goes up to the Chief of Medicine, a human.
Everything runs on GitHub Actions. A label on the issue starts a stage; when the agent finishes it writes a label out, which is the next stage’s label in. Notes go into the issue’s chart with a sentinel such as SINAI:TREATMENT_PLAN so later agents can parse them.
label out = next label in · dashed lines send the patient back
| Run | Lesson | Rule now |
|---|---|---|
| Db2 support | Under two days, $4,172 in tokens. 32 sub-issues, 27 merged PRs, 55 send-backs, 9 escalations, 2 to a human. | Large asks are decomposed into a dependency graph of sub-issues. |
| Plan review | Rejects under 10% of plans, yet caught a telemetry fix that still leaked a hostname. | Rework moves to the earliest, cheapest point. |
| First week | Autonomous merges were not enough to ship to customers. | Human approval mode: every merge gets human eyes. |
| Own backlog | 1,299 issues were filed by agents for other agents. | A human decides what gets admitted. |
| July audit | 25 skill files, ~100,000 words; 23% removable without changing a gate. | Prune prompts like code; a linter is planned. |
Five months treating bugs like patients, Cockroach Labs.
Sources: every number is from the Cockroach Labs post (Adam Storm, Rafi Shamim, 9 October 2026), results table for April 21 to September 11 and the “What it cost” section.