Reproduce, fix, verify
Read the field note below to see how we apply this pattern in practice.
Turn this cable into a shipping system.
We help teams deploy reliable AI workflows with architecture, implementation, and hardening support.
Day 11: Reproduce, fix, verify
Asking Claude Code to "fix this bug" without first reproducing it is the fastest way to close a ticket that reopens three days later.
What we tried
The reproduce-fix-verify loop is a three-phase constraint we now make explicit in every bug prompt:
Phase 1 — Reproduce: Write a failing test or script that proves the bug exists in a repeatable, automated way. This is not optional. If you cannot reproduce it, you cannot know when you've fixed it.
Phase 2 — Fix: Apply the smallest change that makes the reproduction pass. Nothing more. Scope creep during a fix introduces new bugs.
Phase 3 — Verify: Run the full test suite, not just the new reproduction test. A fix that breaks something else is not a fix.
The change that made this work was in how we prompt. Instead of:
Fix the login timeout bug in auth/session.ts
We write:
There is a login timeout bug. Before making any changes:
1. Write a test in auth/session.test.ts that reliably reproduces the failure
2. Confirm the test fails on the current code
3. Then fix only what makes that test pass
4. Then run the full auth test suite and report results
That extra instruction costs us about 30 seconds to write. It has prevented at least four incomplete fixes in the last two months.
What happened
The first time we applied this loop strictly, Claude Code's reproduction test revealed something we hadn't expected: the bug only manifested when two conditions were true simultaneously — a stale token AND a specific network timeout. Our original bug report mentioned only the symptom, not the conditions. The reproduction test exposed both.
The fix took four lines. The verification pass caught one unrelated test that was already broken but that we'd missed. We fixed that too, as a separate commit.
The PR looked different from our usual bugfix PRs: it had a new test, a small targeted change, and a clean test run. Reviewers approved it in 10 minutes because the evidence was all there.
What we learned
- Never say "fix this bug" — say "first write a test that reproduces this bug, then fix it"; Claude Code follows this loop reliably when you make the phases explicit
- A failing test is the specification; the fix is just the work of making it green — this framing keeps the scope honest
- Phase 3 (verify) means running the full suite, not just the reproduction test; regressions hide in the tests you didn't look at
- The three-phase pattern produces a PR with built-in evidence: the reproduction test, the targeted fix, and the clean run — reviewers can understand the full story without asking questions
Going deeper
The standalone cable Reproduce → fix → verify covers the full pattern including how to handle bugs with external dependencies, rollback notes for high-risk fixes, and integrating this loop into a Linear workflow.
Next
- Day 12 — When your CLAUDE.md starts to drift.
Quick answers
What do I get from this cable?
You get a dated field note that explains how we handle this debugging workflow in real Claude Code projects.
How much time should I budget?
Typical effort is 14 min. The cable is marked intermediate.
How do I install the artifact?
This cable is guidance-only and does not ship an installable artifact.
How fresh is the guidance?
The cable is explicitly last verified on 2026-04-17, and includes source links for traceability.
More from @frenxt
Anthropic's Responsible Scaling Policy (Sep 2023) — safety as operating procedure
*A five-part series tracing Anthropic's public thinking through Dario Amodei's writing and the company's model spec — one foundational document per entry, each with FRE|Nxt Labs l…
Anthropic's "brilliant friend" spec — the product voice that defines Claude
*Part 2 of 5 — tracing Anthropic's public thinking with FRE|Nxt Labs production commentary.*
Dario Amodei's Machines of Loving Grace (Oct 2024) — planning against the upside case
*Part 3 of 5 — tracing Anthropic's public thinking with FRE|Nxt Labs production commentary.*