Guides › Documents & Data

Track down the cause of a bug faster

A ranked list of likely causes for an error, with what to check first and how to confirm each, from your error message, logs and relevant code.

Software developerBeginner5 minAI assistant
Open the interactive guideBrowse all guides

When to use it

When you're stuck on a bug

Step by step

  1. Gather the evidence

    Copy the exact error message, stack trace, a few log lines from around the failure and the relevant function. Remove secrets, tokens and customer data first.

  2. Ask for a diagnosis, not a guess

    Paste it all with this prompt.

    Prompt to copyI'm debugging a problem in [language/framework, version]. Expected behaviour: [what should happen]. Actual behaviour: [what happens]. It started [when / after what change]. Error and stack trace: [paste]. Logs: [paste]. Relevant code: [paste]. List the most likely causes ranked by probability. For each: why the evidence points to it, one quick check to confirm or rule it out (a log line to add, a value to inspect, a test to write), and the fix if confirmed. Ask me for any extra information that would narrow it down. Don't rewrite unrelated code.
  3. Run the checks

    Work through the checks in order and tell the assistant what you found; it will narrow the list down.

  4. Lock in the fix

    Once fixed, ask it to draft a regression test that would have caught this bug, and add a short note to the ticket explaining the cause.

What you get

1) Most likely: the date is parsed in UTC but compared in local time, so orders after 11pm fall on the next day. Check: log order.created_at and the comparison value for an order placed at 23:30. Fix: compare both in UTC.

Tips

More Documents & Data guides