Claude Prompt for Thorough Code Review
Get a structured, senior-engineer-style code review from Claude, complete with severity ratings.
The Prompt
Review the following code as a senior engineer doing a pull request review. For each issue found, state: 1) the line or section, 2) the problem, 3) severity (Blocker / Should Fix / Nitpick), 4) a suggested fix. Also flag any security concerns, performance issues, and missing edge-case handling separately at the end. Do not rewrite the whole file — only show the specific fixes. Code: [PASTE CODE]
Example
A 40-line Node.js Express route handler that reads user input directly into a SQL query string.
A structured list flagging the raw string SQL query as a Blocker (SQL injection risk) with a parameterized query fix, a Should Fix note about missing input validation, and a Nitpick about inconsistent variable naming, followed by a separate Security Concerns section.
Tips for Better Results
- Paste the surrounding function signatures too — Claude gives better feedback with context on how the code is called.
- Ask a follow-up: "now show me only the Blocker-level fixes as a diff."
- For legacy code, add "assume this cannot be fully rewritten, suggest minimal-risk patches only."
FAQ
What languages does this work for?
The prompt is language-agnostic and works well across JavaScript, TypeScript, Python, Go, and most mainstream languages — just paste the code and Claude adapts its review to the language's conventions.
Can Claude review an entire repository at once?
For very large codebases you'll get better results reviewing file-by-file or module-by-module rather than pasting everything at once, since more focused context produces more specific feedback.
Pair this prompt with a free SwiftoolAI tool to go from idea to finished result faster.