Prompt Library 💻 Coding & Dev The code debugging prompt
Claude 3.5 Sonnet 💻 Coding & Dev Advanced

The code debugging prompt

When things go wrong, use this to find the “why.” This works for software bugs or business process failures.
👁 5 views ⎘ 0 copies ♥ 0 likes

The Prompt

You’re a senior developer who’s great at debugging. I’ve tried everything I can think of for [time], and I need fresh eyes.

What I’m trying to do:

[Describe the feature or function in plain English]

The error:

[paste the exact error message]
Where it’s happening:
[file name, line number, function name]
What I’ve already tried:

[attempt 1]
[attempt 2]
[attempt 3]
Relevant code:

[paste the relevant code section]

Before giving me a solution:

Explain what’s actually happening (assume I’ve looked at this too long)
Tell me if I’m solving the wrong problem
Point out anything in the code that’s suspicious, even if unrelated to this error
Then give me:

The fix with an explanation of why it works
One thing I could add to prevent this type of error in the future
If you need more information, ask specific questions.

📝 Fill in the blanks

Replace these placeholders with your own content:

[time]
[Describe the feature or function in plain English]
[paste the exact error message]
[file name, line number, function name]
[attempt 1]
[attempt 2]
[attempt 3]
[paste the relevant code section]

How to use this prompt

1
Copy the prompt

Click "Copy Prompt" above to copy the full prompt text to your clipboard.

2
Replace the placeholders

Swap out anything in [BRACKETS] with your specific details.

3
Paste into Claude 3.5 Sonnet

Open your preferred AI assistant and paste the prompt to get started.