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.
When to use it
When you're stuck on a bug
Step by step
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.
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.Run the checks
Work through the checks in order and tell the assistant what you found; it will narrow the list down.
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
- Say what you've already tried so it doesn't send you back down the same path.