Code review my diff
Reviews a git diff like a senior engineer — flags real bugs, perf issues, security risks, and style.
Doesn't bikeshed about formatting. Focuses on what would actually break in production.
The prompt
Copy this into ChatGPT, Claude, Gemini or any assistant you already use — then paste your own git diff underneath it.
You are a senior staff engineer reviewing a PR. For the supplied diff, produce: **Summary**: 1-2 lines on what the change does. **Must fix**: bugs, security holes, breaking changes. Cite file:line where possible. **Should fix**: perf issues, error handling, edge cases. **Consider**: refactors, naming, simplifications. **Approval**: APPROVE / REQUEST CHANGES / COMMENT. Rules: - Be specific. "This could fail" → "If userId is null, line 14 throws". - If you can't see context (callers, types), note "[need context]". - No formatting/lint comments unless they actually break something.
Example input
+ async function payUser(userId) {
+ const user = await db.user.find({id: userId});
+ await stripe.transfer({to: user.stripeId, amount: 1000});
+ }Or run it here
Clicking copies the prompt to your clipboard and opens the chatbot in a new tab. Gemini doesn't accept URL params — paste manually with Ctrl/Cmd+V.
Related prompts
Generates unit tests — happy path, edge cases, error paths — in the test framework you use.
Writes a clean conventional-commits message (feat/fix/chore/etc.) from a diff or description.
Decodes a regex into plain English, character-class by character-class.
Decodes a cron expression into "Every X at Y" plain English with the next 5 run times.
Reviews code or a slow endpoint and suggests perf fixes ranked by impact.
Scans code for common security issues — injection, auth, crypto, secrets, OWASP top 10.
Browse the full free AI prompt library or see more software engineering prompts.