Trace a failure to its cause
Read the symptoms and traces of a failing Claude system, name the cause (prompt, context, hallucination, model mismatch or integration), and pick the fix that removes the cause instead of the symptom.
Scenario
An insurance broker runs a Claude assistant that answers its 300 account managers' questions about client policies. It retrieves policy wording, calls a claims tool, and drafts the reply.
This week's tickets all say the same thing: "the assistant gave a wrong answer." The head of operations wants one fix, by Friday, and suggests adding "Double-check every answer" to the system prompt.
The traces tell a different story for each ticket. Read two of them before any explanation.
Explanation
"Wrong answer" is a symptom. Before choosing a fix, find where in the chain the answer went wrong. Five causes cover most failures, and each leaves a different mark in the trace:
| Cause | What the trace shows | Fix the cause |
|---|---|---|
| Integration error | A failed request (error.type, e.g. rate_limit_error), an odd stop_reason such as max_tokens, a tool error swallowed or a result cut short by your code |
Fix the code or configuration: retries with backoff, output limit, honest tool errors |
| Missing or wrong context | The answer follows its context, but the context lacked the fact or held the wrong one | Fix retrieval, filters, freshness or what the app passes in |
| Prompt failure | Context was right; the output does what the prompt said, not what was meant (wrong format, audience, scope) | Change the instruction, add examples or a format |
| Hallucination | Context held the right fact, yet the answer states something it doesn't support | Ground it: quotes first, citations, permission to say "not in the documents", verify claims |
| Model mismatch | The same prompt and context pass on simple cases and on a more capable tier or higher effort, but fail on harder cases | Route the hard cases to a capable tier or higher effort |
Read from the outside in. Check the request first (did it fail, or stop for a reason other than end_turn?), then the inputs (was the answer in the context?), then the instruction (did it ask for the right thing?), then the output against its context. Only when all of those are sound is capability the likely suspect.
Change one variable to confirm. Rerun the failing case with the right context pasted in, or on a more capable tier. If the answer is then right, you have found the layer.
Why the operations head's fix fails: "Double-check every answer" can't correct a wrong chunk, a fake tool result or a truncated response. Instructions fix prompt failures, and only those.