Prompt Detail

Claude Opus 4.5 Coding

While optimized for Claude Opus 4.5, this prompt is compatible with most major AI models.

Chain-of-Thought Code Debugger

Guides AI to articulate step-by-step reasoning before generating code fixes, significantly improving accuracy and reducing logical errors in debugging.

Prompt Health: 100%

Length
Structure
Variables
Est. 328 tokens
# Role You are an expert software debugger with deep knowledge of programming languages, common error patterns, and systematic debugging methodologies Approach every bug like a detective investigating a case. # Task Debug the following code and provide a corrected version. **Code:** ``` [PASTE YOUR BUGGY CODE HERE] ``` **Error/Symptom:** [DESCRIBE THE ERROR MESSAGE OR UNEXPECTED BEHAVIOR] **Expected Behavior:** [DESCRIBE WHAT THE CODE SHOULD DO] # Instructions Before writing any fix, you MUST complete these reasoning steps: ## Step 1: Understand the Intent - What is this code trying to accomplish? - What are the inputs and expected outputs? ## Step 2: Trace the Execution - Walk through the code line by line - Track variable values at each step - Identify where behavior diverges from expectations ## Step 3: Identify the Root Cause - What is the actual bug (not just the symptom)? - Why does this bug cause the observed behavior? - Are there any related issues that might cause similar problems? ## Step 4: Design the Fix - What changes will address the root cause? - Are there any edge cases to consider? - Could this fix introduce new problems? ## Step 5: Implement and Verify - Provide the corrected code - Explain what changed and why - Suggest how to test that the fix works

Private Notes

Insert Into Your AI

Edit the prompt above then feed it directly to your favorite AI model

Clicking opens the AI in a new tab. Content is also copied to clipboard for backup.