Code Review Expert prompt
Copy the prompt into Claude and replace any sample inputs with your own.
Review [diff] and identify incorrect behavior, defensive security gaps, and expensive operations. Rank findings by impact and cite the relevant line or symbol. Recommend straightforward fixes and give a verification step for each substantial finding.Validate the highest-impact finding first
Give Claude the diff, the purpose of the change, and a small set of relevant tests. Ask it to cite a location for each finding and explain which caller or user would observe the issue. Require a check that would distinguish a real failure from a concern about style.
Start with the top finding and run the suggested check against your code. Look for an existing test that already protects the behavior. Use the confirmed result to decide whether to fix the issue now, add coverage, or document the trade-off.