Skip to content

DirectoryPrompts

Claude

Find and Fix a Bug

Free
  • Free with an account
  • Copy or download
  • Updates included

By downloading this prompt, you agree to our Terms of service.

votes views

Claude Opus 5.5

This prompt finds the cause of a bug that shows no error. Describe what goes wrong and when, then paste the code and what you checked; you get the cause, a fix and a test.

What Find and Fix a Bug gives you

What you get

  • The cause of each bug, with the lines responsible and a confidence rating
  • How the cause produces each symptom, including why it appears only in some cases
  • Other possible causes, each with a quick way to check it
  • A fix and a regression test that fails before the fix

How to use it

  1. 1Describe the symptoms Say what you expected, what happens instead, when it happens and when it does not. "Never on localhost" is a clue, not noise.
  2. 2Paste the code and what you ruled out Include the component, function or query that runs when the bug appears, and what you already checked.
  3. 3Check, fix and keep the test Run the suggested check, apply the fix, and add the regression test so the bug cannot come back unnoticed.

Tips

  • List the cases where the bug does not happen. Those contrasts rule out most of the wrong causes.
  • If you are not sure which code is involved, paste the likeliest file and ask which other file would settle it.
  • Run the regression test before you apply the fix; it should fail. A test that passes on the buggy code protects nothing.

Reviews

No reviews yet

  • Only signed-in readers can review
  • One review per person
  • Never paid for

Frequently Asked Questions

Can AI find a bug without an error message?

Yes. Describe the wrong behavior, when it happens and when it does not, and paste the code that runs. A model can trace the symptoms to the lines responsible, but only within the code you give it, so include the part where the wrong value is produced.

How do I describe a bug to ChatGPT?

Describe what you expected, what happened instead, when it happens and when it does not, and since when. Then paste the code that runs at that moment and what you already ruled out. The contrast between working and failing cases is what narrows the cause.

Can Claude fix bugs in my code?

Yes, Claude can find and fix bugs in code you paste, or across your project in Claude Code. It works best with the symptoms, the relevant code and what you have ruled out. Ask for a test that fails before the fix, so you can prove the bug is gone.

Similar Prompts

More Coding Prompts

Image Prompts

Video Prompts

Trending Prompts

Newest Prompts

Browse all prompts