Back to guide/Developer Tools

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.

claude-code-tutorialfilePath
Edit View
Prompt
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

{{filePath}}

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.