Code Review & Refactor
Separating review from implementation lets you stay in control. Claude Code reads the actual file content rather than working from memory. Rating severity helps you prioritize, and quoting specific code makes issues unambiguous.
Review {{filePath}} and suggest improvements. Do NOT make changes yet — just analyze and report.
**Review criteria:**
1. **Readability:** Are variable/function names clear? Is the logic easy to follow?
2. **Performance:** Any unnecessary re-renders, O(n^2) operations, or missing memoization?
3. **Error handling:** Are failure modes covered? Any silent failures?
4. **Types:** Are TypeScript types precise or using \`any\` / overly broad types?
5. **Duplication:** Is there logic that could be extracted into a shared utility?
6. **Testing:** Is this code easily testable? What would be hard to test and why?
For each issue:
- Quote the specific code
- Explain the problem
- Rate severity: critical / should-fix / nice-to-have
- Provide the improved version
After review, ask me which improvements I want to apply before making any changes.Variables to customize
Why this prompt works
Separating review from implementation lets you stay in control. Claude Code reads the actual file content rather than working from memory. Rating severity helps you prioritize, and quoting specific code makes issues unambiguous.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Get thorough code reviews with actionable feedback tailored to your language, framework, and standards.
Context-Aware Code CompletionProviding the surrounding code and project context lets the model match existing patterns exactly. The constraint against modifying existing code prevents unwanted side effects.
Inline Code SuggestionConstraining suggestions to match existing style and scope produces insertions that feel native to the codebase. The 'no explanation' rule mimics real inline completion behavior.
Code ExplanationThe audience level parameter adjusts complexity automatically. Requiring a usage example ensures the explanation is practical, not just theoretical.