Claude prompt to find and fix bugs in Python code
An official Anthropic example system prompt that asks Claude to find, fix and explain bugs in Python code.
- Model
- Claude
- Task
- Coding
- Source
- Official example from Anthropic
The prompt tells Claude to analyze a Python snippet, identify bugs or errors, return a corrected version and explain each problem and fix, with code that is functional, efficient and follows Python best practices. It is the system prompt of the Python bug buster entry in Anthropic’s prompt library, where the buggy code is passed as the user message. To adapt it, keep it as the system prompt and send your own code as the message.
The prompt is quoted from Python bug buster - Claude API Docs.
- Prompt
- Your task is to analyze the provided Python code snippet, identify any bugs or errors present, and provide a corrected version of the code that resolves these issues. Explain the problems you found in the original code and how your fixes address them. The corrected code should be functional, efficient, and adhere to best practices in Python programming.
- What it produces
- Asks Claude, as a system prompt, to find bugs in Python code, fix them and explain the fixes.
- Source link
- platform.claude.com
- Added
Questions
Where does my code go?
What is a system prompt?
Where does this prompt come from?
See also
Sources: each prompt is quoted from the official example or the public post linked on its page. Promptline is not affiliated with OpenAI, Anthropic, Google or Midjourney.
