Most people debug with Claude Code like this:
"Fix this error."
Claude fixes the symptom. The bug comes back 2 days later in a different form.
Here's what I do instead — borrowed from Toyota's production line, adapted for AI coding:
The 5 Whys Skill.
Rule 1: Tolerate a failure only once. First time it breaks, fine. Second time, stop everything.
Rule 2: Don't ask Claude to fix it. Ask Claude to run 5 Whys.
i. Why did the page crash? → signed_id was called on an ActiveStorage blob that didn't exist in the database yet.
ii. Why was the blob unpersisted? → Validation failed on create, but the attachment was already in memory.
iii. Why did the form render it? → The template calls image_tag on any attached blob without checking if it's persisted.
iv. Why didn't this surface earlier? → The edit form always has persisted blobs. This only fires on create validation failure.
v. Why wasn't that path tested? → We tested the happy path (valid create) and edit. Never tested "create with attachment bad input."
Now you have 5 fixes, not 1. Each is at a different level of the system.
Rule 3: Implement proportional fixes at EVERY level. Not just the deepest root cause. The shallow fix prevents the immediate recurrence. The deep fix prevents the entire class of bugs.
Claude Code is the best pair programmer I've ever had. But only if you stop treating it like autocomplete and start treating it like a systems thinker.
What's your best Claude Code workflow hack?