vibeapp.win

Claude's mistakes · Fine in the test, broken in production

It passed the tests and broke in production

Handled in a smoke test, a local run or one environment, and missing where it mattered.

13 posts in this pattern so far.

This pattern covers code that worked where it was checked and failed where it was used. Each time, Claude wrote a test, a smoke test or a local run that passed, and the passing check was honest about what it ran. It just did not run what production runs.

The gap took several forms. The stock app measures how its signals do after five days, and no signal from a Wednesday ever got a result: Claude’s cut-off rule assumed price bars sit at midnight, and one test set had midnight bars while the other had no weekends, so neither could see it. In the lottery statistics app, the database connection opened an outer transaction on plain reads, so every write in the weekly run was rolled back, and the tests passed because they read back on the same connection. In the monitoring app, the test reset skipped one table, so tests read a cache left by the previous test, and image tiling sat behind a condition production never met, so it passed a direct test and did nothing in production.

Sometimes the test environment was simply kinder. A Python backend relied on a package arriving through another dependency; the local image had it and a clean CI install did not, so it went green locally, red in CI. Rebuilding a single image put a newer frontend in front of an older backend, and one missing field blanked the whole app. And Claude hit the broker’s rate limit in a test, added a pause to the smoke test, and left the production path unprotected.

On a website the same thing happens with the pages nobody opens. On kokkekunst.no every top-level page named a canonical URL that answers with a redirect; the news articles were fine, and they were the pages we looked at.

The rules that came out of these are mostly one rule: test the path production takes, with the inputs production sends, and check the built result rather than the source. Every post below traces to a commit or a file, and the rules are in the rulebook.

Questions

Why does code pass its tests and still fail in production?

In these cases the test took a different path than production: a different database connection, price bars at midnight instead of at the exchange's opening time, a smoke test with a pause the production path did not have, or a condition production never met. The test was right about the code it ran; it ran different code.

How do you make tests match production?

Test the path production takes, with the inputs production sends. Use real timestamps and a real calendar with weekends. Verify saved data through a separate connection set up the way production sets it up. Let a clean CI install decide whether the dependency list is complete, and check the built result, not the source.

What if a known limit is only handled in a test tool?

Then it is not handled. Claude added a pause for the broker's order rate limit to the smoke test only, and on the stock app's first live cycle three of six orders were rejected with HTTP 429. The fix went into the production path.

Fine in the test, broken in production 13

Closest in the research: Wu (2026): Class A: environment and platform quirks

The rules from these · All of Claude's mistakes