How to Use Cursor for Code Review: Review Rules, Diff Checks and PR Workflows
Use Cursor for code review: review your branch before pushing, review PRs with the GitHub CLI, use Bugbot, and add a copy-ready .cursor/rules code review rule.
Cursor is built for writing code, but its codebase search is just as useful for reviewing it: the Agent can see how changed code connects to the rest of the project and whether it breaks patterns used elsewhere. Cursor itself recommends self-review before submitting PRs. What usually goes wrong is the prompt: "review this" produces generic advice. This guide gives you three workflows, a copy-ready review rule and an honest look at where the editor-chat approach starts to hurt.
Way 1: Review your branch in the Agent before you push
Open the Agent chat on your feature branch and give it an explicit scope. Telling it to run the diff itself means it reviews exactly what changed, not whatever files happen to be open.
Review the changes on this branch compared with origin/main.
Run git diff origin/main...HEAD to see them.
For each modified function, check its callers and tests.
Report bugs, security issues and missing tests with file and line.
Do not edit any files.Once a prompt works well for your codebase, Cursor lets you save it as a custom command (for example /review) so you do not retype it before every PR.
Way 2: Review an existing Pull Request with the GitHub CLI
To review a teammate's PR, check it out locally so Cursor can read the full code around the change, then save the PR description and diff where the Agent can read them.
gh pr checkout 123
gh pr view 123 > /tmp/pr-123.md
gh pr diff 123 > /tmp/pr-123.diffRead /tmp/pr-123.md for the intent and /tmp/pr-123.diff for the changes.
Check whether the code does what the description says.
Follow the code-review rule. Do not edit files.Way 3: Let Bugbot review PRs on GitHub
Cursor Bugbot reviews Pull Requests automatically when you push and looks for logic errors rather than lint issues. It reads its own instructions from .cursor/BUGBOT.md, not from your editor rules. Our tutorial on configuring BUGBOT.md for PR reviews covers the setup, and Bugbot vs Codex vs Claude Code compares it with other reviewers.
Create a code review rule in Cursor
Project rules live in .cursor/rules as .mdc files with a small frontmatter block (description, globs, alwaysApply). A plain .md file in that folder is ignored, and the single .cursorrules file is the legacy format. For reviews, use a rule the Agent pulls in by description, so it does not clutter normal coding tasks.
---
description: Strict code review of a diff or Pull Request. Use when asked to review changes.
alwaysApply: false
---
# Code review rule
You are reviewing changes, not writing them. Do not edit files.
## Scope
- Review only the diff you are given, but read callers, tests and types it touches.
- Compare with how similar code is handled elsewhere in the repository.
## Check, in this order
1. Correctness: logic errors, null/undefined, off-by-one, unhandled errors.
2. Security: authorization checks, input validation, secrets, injection.
3. Data: migrations, backwards compatibility, race conditions.
4. Tests: is the new behavior covered? Is a regression test missing?
## Output format
For every finding:
- Severity: critical | major | minor
- File and line
- What is wrong and why it matters
- Suggested fix (one or two lines)
If nothing important is found, say so. Skip formatting and naming nits.Why this rule works
- Read-only: the Agent reviews instead of silently "fixing" your code.
- Ordered checks: correctness and security come before style.
- Fixed output: every finding has severity, location and a fix, so it is easy to act on.
For language-specific variants (TypeScript, Python) and step-by-step setup, follow the tutorial Create a Code Review Rule in Cursor.
Where reviewing in the editor chat starts to hurt
- Large PRs fill the chat context, and the Agent loses track of earlier files.
- Findings live in a chat thread: no history per branch or per PR.
- You repeat the same setup (checkout, diff, prompt) for every review.
- Posting results to GitHub or GitLab is manual copy and paste.
How CodeCrab automates this on your machine
CodeCrab is a desktop app that runs these reviews with the AI tools you already use, including Cursor, Claude Code, Codex and Copilot. It prepares the diff and context for each PR, runs pre-push reviews on your branch, collects reviewer feedback in My PRs and keeps a history of every review. Your code stays on your laptop. See the Cursor integration guide or the Claude Code version of this workflow in Can Claude Code review PRs?
Quick questions
Does Cursor have a built-in code review?
Bugbot reviews PRs on GitHub; inside the editor, you review with the Agent and your own rules or commands.
Should I still use .cursorrules?
It still works but is legacy. Move rules into .cursor/rules/*.mdc and do not keep conflicting copies.
Does Bugbot read my .mdc rules?
No. Bugbot uses .cursor/BUGBOT.md.
What about Copilot or GitLab?
See GitHub Copilot code review and reviewing GitLab merge requests with AI.
Try it on your next Pull Request
Free Public Beta — runs 100% on your machine. No code leaving your laptop.
Download CodeCrabKEEP READING
GitHub Copilot Code Review: How It Works, Custom Instructions and Local Reviews
How GitHub Copilot code review works on Pull Requests, how to customize it with copilot-instructions.md, and how to review your branch locally with Copilot CLI before pushing.
GitLab AI Code Review: How to Review Merge Requests Locally with AI
Review GitLab merge requests with AI on your own machine: glab mr checkout, view and diff, a copy-ready review prompt for Claude Code, Cursor, Codex or Copilot CLI.
Can Claude Code Review PRs? How to Review a Pull Request with Claude Code (Step by Step)
Yes, Claude Code can review Pull Requests. Learn three ways to review a PR with Claude Code: pre-push branch reviews, GitHub CLI PR reviews and repeatable claude -p reviews, with copy-ready prompts.
The AI-Era Code Review Checklist: How to Review AI-Generated Code (and Vibe-Coded PRs)
A practical code review checklist for AI-generated code: verify authorization, API contracts, data integrity and tests, with copy-ready review templates and a repository-aware prompt.
Cursor Bugbot vs Codex vs Claude Code: Which AI Reviews Pull Requests Best?
Compare Cursor Bugbot, OpenAI Codex and Claude Code for PR and pre-push reviews: triggers, repository rules, permissions, privacy, practical prompts and a fair evaluation method.
Claude Code Subagents for Code Review: Security, Performance and Architecture Reviewers
Build three specialized Claude Code review subagents with copy-ready definitions: a security reviewer, a performance reviewer and an architecture reviewer, each with isolated context and read-only tools.
Best AI Code Review Tools in 2026: CodeRabbit vs Greptile vs Qodo vs Cursor Bugbot vs CodeCrab
A no-pricing comparison of the leading AI code review tools: where your code goes, what permissions you grant, how much context the reviewer sees, and when the review happens.
Claude Code Skills for Code Review: How to Create, Install and Activate Them
Create and install a custom Claude Code review skill with a copy-ready SKILL.md template. Learn local vs global paths, activation, troubleshooting, and the CodeCrab output format.
Local-First AI Code Review: Why Enterprise Codebases Can't Rely on Cloud Review Bots
Cloud review bots copy your diffs to vendor servers and ask for org-wide permissions. Here is how local AI code review and self-hosted PR review really differ, and what to verify before trusting either.
How to Review Code with Claude Code: From Generic Prompts to Repo-Aware Reviews
Claude Code can review Pull Requests, but generic prompts miss what matters. Learn how review skills, repository context and a fixed output format turn it into a real reviewer.
AI Can Write Your Code. But Who Reviews It? The New PR Bottleneck
AI made writing code cheap, but reviewing AI-generated code is now the bottleneck. Learn why PR queues grow, why rubber-stamping is risky, and how to review before the Pull Request.
Code review that fits your workflow: local skills and repository-aware agents
CodeCrab combines your existing local review skills with per-repository profiles and specialized agents, so you can review PRs and pre-push changes with the full codebase in context.
PR Code Reviews: how CodeCrab unblocks your team in the AI era
AI writes more code than ever, so review queues are the new bottleneck. Here is how CodeCrab reviews Pull Requests locally, with repo-specific skills and full engineer control.
My PRs — Feedback: turn vague review comments into a clear fix
Generic or unclear feedback on your Pull Request stalls you for days. CodeCrab investigates every comment with full local code context and hands you a ready-to-run fix prompt.
Pre-Push Code Review: catch bugs before the Pull Request even exists
The cheapest bug is the one that never reaches a PR. CodeCrab reviews your local changes with your repo's own profile and skills, so you push higher-quality code the first time.
