Log In Sign Up

Code Review Prompt

Development Claude GPT-4
2 views Added March 26, 2026

Prompt

Review the following code for: security vulnerabilities, performance issues, best practice violations, readability, and potential bugs. Language: {language}. Context: {context}. Code: {code}. Provide: severity rating (critical/warning/info) for each finding, specific line references, suggested fixes, and an overall assessment.

Variables

language context code

About This Prompt

Guide AI to perform thorough code reviews with security, performance, and best practice checks.

Share

Example Output

**Overall Assessment: 7/10 — Good structure with some security concerns**

**Critical:**
- Line 23: SQL query uses string concatenation instead of parameterized queries. This is vulnerable to SQL injection.
- Fix: Use prepared statements with bound parameters

**Warning:**
- Line 45: No input validation on user-submitted email field
- Fix: Add email format validation before processing
- Line 67: API key hardcoded in source file
- Fix: Move to environment variables

**Info:**
- Line 12: Variable name 'x' is not descriptive
- Suggest: Rename to 'userCount' or similar

Usage Tips

  • Include the full code block
  • Specify the language and framework
  • Mention any known constraints
  • Ask about specific concerns