How to use this prompt
- Paste the code and the full error. The complete error message and stack trace usually point straight to the problem.
- Explain what should happen and what actually happens. This is often the fastest way to find the cause.
- Remove passwords, API keys and secrets from your code before pasting it into any AI app.
- Click Generate prompt, then Copy prompt or open it in ChatGPT, Claude, Gemini, Copilot, Perplexity, Grok or any AI app.
- Still broken? Keep the chat open and paste the new error: "I tried the fix, now I get this".
Debugging tips
- Read the error message carefully. The file name and line number tell you where to look first.
- Change one thing at a time, then test. Changing many things at once makes it hard to know what worked.
- Think about what changed recently. Most bugs come from the last edit, update or deploy.
- Use console.log, print or breakpoints to check what your variables really contain.
- Want to understand the code first? Use the Code Explainer, and plan new features with the Website & App Builder Planner.
Example: how to fill it in
Here is how a developer might fill in the form for a bug in a Python script.
| Field | Example answer |
|---|---|
| Paste your code here | The function that reads a CSV file and totals sales |
| Error message or log | KeyError: 'amount' |
| What should happen | Print the total sales for each month |
| What actually happens | The script stops with a KeyError on the first row |
| Programming language | Python |
| What you already tried | Checked the file exists and printed the first row |
Common mistakes and how to fix them
- Pasting only the error. Include the code, the full error and what you expected. All three are needed to find the cause.
- Leaving out versions. Add framework and library versions. Many bugs come from version differences.
- Applying the fix blindly. Understand the cause, then test the fix, including edge cases.
- Sharing secrets. Remove keys, passwords and personal data from code and logs before pasting.
Follow-up prompts to try
After the first result, keep the same chat open and send one of these:
- "Explain why this bug happened in simple words."
- "Write a test that would have caught this bug."
- "How do I prevent this kind of bug in the future?"
- "Check the rest of the function for similar problems."
Frequently asked questions
Which languages does it work with?
Any common language, including Python, JavaScript, PHP, Java, C# and SQL.
Can it fix build and deployment errors?
Yes. Paste the full build log and describe your setup.
What if the first fix does not work?
Paste the new error and what you changed. Debugging often takes a few rounds.
Is it OK for beginners?
Yes. Set your coding level and it will explain the cause simply.
