A prompt for fixing an error in your code
Copy this into ChatGPT, Claude, Gemini or any other AI. It is the professional version of a request most people type in a few words.
1What most people type
“fix this error in my code”
2The professional prompt
I need help fixing an error in my code. Here is the code:
[paste your code here]
This is the error message I get, copied exactly as it appears:
[paste the full error message or describe what goes wrong]
The code is written in [language and version, plus any framework], and it should do the following: [what the code is meant to do].
Please find the cause of the error and give me a corrected version of the code. Explain in a few plain sentences what was wrong and what you changed, so I can avoid the mistake next time. Change only what is needed to fix the problem, and tell me if you spot other bugs, but do not rewrite parts that work. If the information I gave is not enough to be sure of the cause, ask me for what you need before answering. If you are guessing between several possible causes, say so and list them in order of likelihood.
Before you use it, replace each [highlighted part] with your own details.
Why this version works
- Placeholders for the code and the exact error give the AI what it needs to find the real cause.
- Saying what the code should do lets the AI spot mistakes that don't show up in the error message.
- Asking for a short explanation helps you understand the fix instead of just copying it.
- Telling the AI to change only what's needed keeps it from rewriting code that already works.
Make it even better
- Paste the exact error message you see, including any line numbers, so the assistant knows precisely what went wrong.
- Share the part of your code that causes the problem, plus what you expected it to do instead.
- Mention the programming language, version, and tools you are using, since fixes often depend on them.
Free · no sign-up
Need something different?
Say what you want in your own words and the Prompt Translator writes the professional prompt for you.
More prompts for coding
This prompt was written by an AI through our Prompt Translator, exactly as a visitor would get it. Read it and adjust it before you use it. See the whole prompt library.