Skip to content
>devspeak
← glossary
patternCommunication Patterns

Identify the root cause before modifying code

Ask the agent to find the real underlying reason for a problem, and explain it to you, before it starts changing code.

a bit more technical

Separate diagnosis from repair: trace the failure back to the specific defect, such as a wrong assumption, bad data, or a missing check, and confirm it explains every symptom before any fix is written.

picture it

A doctor figuring out why you have a fever before prescribing anything. Fever medicine makes you feel better, but if it's an infection, the infection is still there.

✗ instead of
the checkout total is wrong sometimes, just fix it asap
✓ try
The checkout total is sometimes wrong. Identify the root cause before modifying any code, and explain it to me with evidence. Then propose the smallest fix for that cause.
why it matters

Agents are eager to change code. Without this instruction they often fix the first plausible thing, which can hide the symptom while the real cause keeps doing damage elsewhere.

what your agent might say
agent
Root cause: the coupon handler runs every time the page redraws, so the discount stacks. Rounding the total would only hide it. Want me to fix the handler?
how you might use it
you → your agent
Identify the root cause of the wrong checkout total and explain it to me, with evidence, before modifying any code.
common mistake

Accepting the first explanation that sounds right. A real root cause explains every symptom, not just the one you noticed.

builds on