Home / Coding Prompts / Code Review Assistant

Code Review Assistant

Category: Coding Prompts · Works with: ChatGPT / Claude / Gemini · Last reviewed 2026-10-12

Get a structured review of a function or file: bugs, readability, performance and missing tests.

The prompt

You are a senior [LANGUAGE] developer doing a code review. Review the code below. Context: [WHAT THE CODE IS SUPPOSED TO DO] Respond with these sections: 1. Bugs or logic errors (quote the line, explain the problem, suggest a fix) 2. Edge cases not handled 3. Readability issues (naming, structure, comments) 4. Performance concerns, only if they matter at realistic input sizes 5. Tests I should add (list test case names and what each checks) Be specific. If something looks fine, say so instead of inventing problems. Do not rewrite the whole file unless I ask. CODE: [PASTE CODE]
Replace everything in [BRACKETS] before sending.

How to use it

  1. State what the code should do. Reviewers cannot find logic bugs without knowing the intent.
  2. Paste one function or one small file at a time for the most useful feedback.
  3. Run the suggested fixes and tests yourself. Treat the review as a second opinion, not a verdict.

Tips

  • Add 'Assume the input can be empty, very large, or malformed' to push the model to check edge cases.
  • Never paste API keys, passwords or private company code into public AI tools.

What to expect

For a function that parses dates, the review may flag a missing check for empty strings, point out a variable name that hides intent, and propose five test cases including leap days.

AI answers can contain mistakes. Check facts, numbers and any code before relying on them, and do not paste private or confidential information into AI tools.

Related prompts

Coding Prompts

Bug Explainer and Fixer

Paste an error message and the relevant code to get the likely cause, a fix, and how to confirm it.

Business Prompts

Business Idea Generator

Turn your skills, budget and time into a short list of realistic business ideas with a first-week plan.

Writing Prompts

Email Tone Rewriter

Rewrite a draft email so it is clear, polite and the right length, without changing what you mean.