42 Tests Green, Still a Bug: Why This Developer Fixed It With a Pre-Commit Hook, Not Another CLAUDE.md Line
- Level Advanced
- Setup1–3 hrs (estimated)
- Evidence Some evidence
- CostNot stated in source
- No-codeNo
What they did
A developer's Claude Code session passed 42 tests but still burned an invoice credit-note number (it issued CN-0004 where CN-0002 was due). The session's /retro review called it smooth and found nothing until he pointed out the failure. His fixes went into enforcement instead of instructions: a pre-commit hook, a test, a line in the coding standards and a doc comment. That was 4 files and 30 lines, with 0 lines added to CLAUDE.md.
How it went
dev.to post by aidiveyt (Oct 29, 2026): 42 tests green but credit-note CN-0004 issued instead of CN-0002; /retro missed it until told; fix was a pre-commit hook, a test, a standards line and a doc comment (4 files, 30 lines, 0 CLAUDE.md lines)
Worth knowing
- dev.to post by aidiveyt (Oct 29, 2026): 42 tests green but credit-note CN-0004 issued instead of CN-0002; /retro missed it until told; fix was a pre-commit hook, a test, a standards line and a doc comment (4 files, 30 lines, 0 CLAUDE.md lines).
Prompt
Cleaned version rewritten from the source — not a direct quote.
This bug got past [number] passing tests: [describe the bug]. Don't add a new rule to the agent instructions file. Instead, find where this mistake could be caught automatically and propose the smallest checks that would have failed: a test, a pre-commit hook, a lint rule or a code comment at the risky spot. Show me the diff for each and explain what each one catches.
Recommended
Try it in Grok Bot
- Copy the prompt (button below).
- Open Grok Bot chat and paste it. Replace any [bracketed] placeholders.
- Connect the listed tools (as needed) as connectors when Grok Bot asks.
- If the task repeats, ask: "Make this a daily routine."
Alternatives: the same prompt works in Claude Code, Claude, ChatGPT Agent, OpenClaw.
Set it up
Stack: Claude Code
- Read the original source for full context.
- Connect the tools your agent needs.
- Paste the prompt and replace [bracketed] placeholders.
- Run once manually and check the output before scheduling it.
Generic suggested steps, not from the source.
Evidence
dev.to post by aidiveyt (Oct 29, 2026): 42 tests green but credit-note CN-0004 issued instead of CN-0002; /retro missed it until told; fix was a pre-commit hook, a test, a standards line and a doc comment (4 files, 30 lines, 0 CLAUDE.md lines)
Source: Web · 2026-10-29 · Verified by us: not yet · Report broken or outdated