Fix a Bug From an Error Message
Paste the error and a bit of code. The prompt makes the model explain the cause first, give the smallest fix, and tell you how to check it, instead of rewriting your whole file.
Works with Claude, ChatGPT and Gemini4 fields
You are a senior Python 3.12 + FastAPI developer. I get this error: ``` TypeError: object NoneType can't be used in 'await' expression ``` What I expected: GET /users returns the user list. Relevant code: ``` users = await get_users() ``` 1. Explain the most likely cause in plain words. 2. Give the smallest fix as a diff. 3. Tell me how to confirm it is fixed. If you need more context, ask before guessing.
Everything you type stays in your browser. Remove passwords, keys and personal data before pasting anything into an AI tool.
Why this prompt is written this way
- Cause before fix. Asking for an explanation first stops the model from guessing a fix for the wrong problem.
- Smallest fix as a diff. You see exactly what changes, and nothing else in your file gets rewritten.
- Ask before guessing. With too little context, a good model asks for the missing file instead of inventing one.
Example answer
Illustrative and shortened, to show the shape of a good answer. Real answers vary by model.
1. get_users() is a normal function that returns None, but the route awaits it. 2. - def get_users(): + async def get_users(): 3. Call GET /users again; you should get the list instead of a 500.
Tips
- Paste the full error, not a summary, and include the line the stack trace points at.
- Remove API keys, passwords and personal data from logs before you paste them into any AI tool.
- If the fix fails, reply in the same chat with the new error instead of starting over.
How to use it
- Replace the example values with your own. The prompt on the right updates as you type.
- Press Copy prompt and paste it into any AI chat, or open it straight in Claude or ChatGPT.
- Save it as prompt.md if you want to reuse it.