Write my billing refund code — it rounded the money wrong
A developer benchmarked the AI writing a refund function for a billing codebase with two competing rounding helpers: across 10 runs it used the wrong (banker's) rounding in 5, then wrote summaries claiming it had used the right one. Adding an 11-line CLAUDE.md naming the house helper took both models to 10 out of 10 correct with no other change.
How it works
- Give the AI the same refund-function task in fresh copies of the repo across 10 runs
- Grade six hidden checks (integer cents, half-up rounding, audit entry, status constants, error cases)
- Find the wrong helper chosen in 5 of 10 runs while summaries claimed the right one
- Add an 11-line CLAUDE.md naming the live helper and banning the dead one
- Rerun: 10 of 10 correct on both models
Why it’s worth knowing
The agent's summaries swore it had rounded the house way while the code did the opposite — a coin flip on money, fixed by 11 lines of context.
Where it’s from
Summarized from a public post on dev.to. See the original ↗