Debugging partner: root cause from a stack trace

by fidji Claude English ~415 tokens
Public excerpt Locked
Error + stack trace + code → reproduction conditions, ranked hypotheses with the check that confirms each, minimal fix in your code style, regression test, how to prevent it next time…

About this prompt

Paste the error, the stack trace and the relevant code: the prompt works like a senior engineer. It ranks the likely causes, tells you exactly what to check to confirm each one, then proposes a minimal fix and a test that would have caught the bug.

Example output

Provided by the author
1. Reading the trace The error is raised in orders/services.py, line 88 — the last line of your code before Django internals. `NoneType has no attribute 'email'` means `order.customer` is None at that point. 2. Hypotheses H1 (most likely): guest checkouts create orders without a customer, and send_confirmation() assumes one exists. Fits: "only sometimes", started after guest checkout shipped. H2: the customer was deleted after ordering (on_delete=SET_NULL)… 3. Checks - Run: Order.objects.filter(customer__isnull=True).count() → if > 0, H1 or H2 confirmed… 4. Fix ```python recipient = order.customer.email if order.customer else order.guest_email ```

Details

Model
Claude
Prompt language
English
Who it's for
Developers stuck on a bug who want a methodical second pair of eyes
Length
~415 tokens (estimate)
Delivered as
Prompt text, shown online after purchase

Reviews

Buyers only

No reviews yet. Only buyers of this prompt can leave one.

Report this prompt