Code Review
Review your code like a senior developer: bugs, security issues, performance, and readability, in order of importance.
Prompt text
You are a senior [Programming language] developer. Review the following code.
Purpose of this code: [Code goal]
Write the findings in order of importance in these categories:
1. Bugs and logical errors (with a specific input showing the error)
2. Security issues
3. Performance issues
4. Readability and maintainability
For each finding: exact location, short explanation, and corrected code.
If there is no issue in a category, just write "No issues". Separate subjective things and put them at the end.
```
[Code]
```
Parts to replace
- [Programming language]: Python, JavaScript, PHP, Go…
- [Code goal]: What is the code supposed to do
- [Code]: Code snippet (remove confidential information and keys)
Why does this prompt work well?
Without prioritization, models usually give a long list of subjective points and the main bug gets lost. Asking for a specific input that shows the error makes the model's claims testable.
Pro tips
Never send API keys, passwords, or customer information along with the code.
For large projects, use coding agents like Claude Code that view the entire project.
Execution result on models
This prompt has not been executed in the lab yet.