Branch Review — Local PR Diff


Review your branch like a GitHub Pull Request, locally inside VS Code — with all the IDE power that the GitHub web UI lacks.
GitHub's web diff can't Go to Definition, Find All References, or search your codebase, because it's just rendering text with no language server. Branch Review shows the same PR-style "files changed" view, but every diff opens against your real checked-out files, so full IntelliSense and code navigation just work.
No pull request required. No remote required. It works on local-only commits, pushed branches, and uncommitted edits alike — it simply compares your current branch against its base.
Contents
Features
Core review
- Changes vs Base tree — a GitHub-style, collapsing folder tree of every changed file in a dedicated sidebar, color-coded by status (Added / Modified / Deleted / Renamed).
- Real diffs with real navigation — click any file to open a base-branch vs working-tree diff. Because the right-hand side is your actual file, Go to Definition, Find All References, hover, and workspace search all work on the changed code.
- Review-aware Go to Definition —
F12 inside a review diff opens the target's diff when the definition lives in a changed file, keeping you in review flow; unchanged targets open normally and are revealed in the Explorer.
- Open All Changes — stack every change in VS Code's native multi-file diff editor with one click.
- Search in changed files — live, case-insensitive search across exactly the files in the review (including a scoped commit selection); pick a result to open it in the diff view, scrolled to the matching line, instead of a plain editor.
Scope the diff
- Select commits to view — scope the diff to all commits, a single commit, or any subset, just like GitHub's "Select commits to view" picker. Only your branch's own commits are listed (first-parent chain), so merging an upstream branch down shows one merge entry instead of every upstream commit.
- Exclude commits from view — the inverse picker: check the commits to leave out and everything else stays in the diff. The selection is remembered per branch and pre-checked when you reopen either picker.
- Smart base detection — auto-detects
main / master / develop / trunk (local or origin/…) and compares using the merge-base, so you see exactly what your branch introduced, not unrelated commits on the base. Override anytime from the status bar.
Track your progress
- Viewed files — GitHub-style checkbox on every file (and every folder, to mark its whole subtree at once); viewed files fade out and the title/status bar track
n/m viewed. State persists per branch and only resets for a file when its content actually changes.
- Reviewed lines — mark any selection (or a whole hunk via CodeLens) as reviewed with
Ctrl+Alt+R or right-click. Reviewed lines get a theme-aware blue highlight plus a gutter checkmark (so it stays visible even over added/removed diff colors) and per-file % reviewed in the sidebar; marks survive refreshes and re-anchor when unrelated code moves.
- Next Unviewed File — jump straight to the next file you haven't checked off, in tree order, wrapping around once.
- Next / Previous Change — walk hunk-to-hunk across every changed file in tree order with
Ctrl+Alt+N / Ctrl+Alt+P, each stop opening the diff at the right line.
- Review checkpoints (interdiff) — mark "reviewed as of here", then toggle Changes Since Checkpoint to see only what changed after your last pass, diffed against the checkpoint instead of the base. The question every re-review starts with, answered.
- Sidebar ↔ editor sync — opening a review diff (or any changed file) reveals and selects it in the Changes tree automatically.
- Local review comments — GitHub-style inline threads on the final code: comment, reply, resolve, minimize, or delete. Minimize collapses a thread out of the way without resolving or deleting it. Anchored to the code text (edits move them, deleted code marks them outdated), persisted per branch, and exportable as markdown to paste into the real PR. Files with comments show a
💬 count in the sidebar.
- Findings view — every open finding (AI, local checks, and yours) in one sidebar list, grouped by severity, worst first, with a badge count. Click to open the diff on the exact line.
- Review gate — while open findings at or above your chosen severity remain, the status bar turns yellow and Check Review Gate says so. A pre-push conscience, not a hard block.
- Post Review to GitHub PR — either one real GitHub review with every open thread anchored inline on its lines (unapplied fixes as committable
```suggestion blocks), or the whole review as a single summary comment. Via gh, with a confirmation step since it's visible to the whole team.
AI Review — a full reviewer, not just a linter
- Zero setup with Copilot — if you have GitHub Copilot, AI Review works out of the box through the VS Code Language Model API. Also supports your own Anthropic API key or an already-authenticated Claude Code CLI.
- Branch summary & verdict — every run starts with a PR-style summary: what the branch does, a per-file walkthrough table, and an approve / comment / request changes verdict. View it anytime with
Show AI Review Summary; it's included when you export or post the review.
- Inline findings with severity — bugs 🐞, issues ⚠️, and suggestions 💡 land as real inline comment threads on the exact lines (the same mechanism GitHub's PR extension uses), shown expanded by default, reviewed in parallel across files with results appearing as each file finishes.
- One-click fixes — when the AI is confident, the comment includes a Suggested fix diff preview with an Apply Suggested Fix button that writes it directly into the file; exports render as GitHub
```suggestion blocks. For anything needing judgment it leaves a plain comment. Apply All Suggested Fixes applies every pending fix in one confirmed action, skipping (and reporting) anything the code has drifted away from.
- Agentic context — the reviewer can ask to see up to 3 other repository files before judging a change (say, the definition of a function the diff calls), then reviews with that context. On by default.
- Local checks, no AI needed — instant deterministic findings on changed lines: unresolved merge-conflict markers, likely hardcoded secrets (AWS/GitHub/Slack/Anthropic keys, private keys, credential assignments), leftover
console.log/debugger, new TODO/FIXMEs. Bundled with every AI run and available standalone via Run Local Checks — no provider, no key.
- Generate PR Title & Description — one AI pass over the branch's diffs, commit subjects, and your
.github/pull_request_template.md produces a ready-to-post title + body: copy it, open it as markdown, or create the PR directly via gh pr create.
- Prompt caching on the Anthropic API — the run-constant part of every prompt is cached across a run's files (cache reads cost ~10x less than fresh input tokens), so multi-file reviews get much cheaper. On by default.
- Talk back to the reviewer — reply on any AI thread ("why?", "isn't this handled?") and the AI answers in-thread with the file and diff as context.
- Verified findings, less noise — a second AI pass re-checks every finding and silently drops the unconfirmed ones (on by default; skipped in quick mode).
- Incremental re-review — re-running only reviews files that changed since the last pass; previous open AI comments on a re-reviewed file are replaced, never duplicated.
- It learns what you dismiss — deleting an AI comment records it as noise; resolved AI threads count as "already handled". Both are fed back so the same finding doesn't come back on the next run.
- Team review guidelines — drop a
.branchreview.md in the repo (or reuse .github/copilot-instructions.md / CLAUDE.md) and every prompt follows your team's rules.
- Review modes —
quick (diff-only, cheapest), standard (full file + verification), thorough (every other file's diff in context — catches changed signatures with un-updated callers).
- Review Selected File(s) with AI — select one or more files (or a folder) in the tree and right-click to scope an AI review to just that selection, instead of the whole branch.
- Live activity view — a dedicated AI Review Activity section in the sidebar pops open when a review starts and shows every step as it happens: reading files, summarizing, reviewing and verifying each file, and what each step produced. Collapse or reopen it anytime. A status-bar item (click to cancel) tracks progress too, finished files open automatically, and the summary opens by default when the run completes.
- Auto-review on commit (opt-in) — run an incremental AI pass automatically after each commit.
Always live
- Refreshes automatically on commit, checkout, or file edit. A status-bar item and view badge show the changed-file count — none of your review progress is lost on refresh.
Usage
- Open a folder that is a git repository.
- Click the Branch Review icon in the activity bar.
- Browse the changed files; click one to open its diff.
- Use the title-bar buttons to scope the review, search, mark progress, or run an AI pass.
Commands
Core review & navigation
| Command |
Description |
Branch Review: Refresh |
Recompute the changed-file list. |
Branch Review: Open All Changes (Multi-file Diff) |
Open every change in the multi-file diff editor. |
Branch Review: Go to Definition (Review-Aware) |
F12 in a review diff; changed targets open as diffs, others as normal editors. |
Branch Review: Search in Changed Files |
Live search across changed files; results open in the diff view. |
Scoping the diff
| Command |
Description |
Branch Review: Select Base Branch |
Choose the base branch (or return to auto-detect). |
Branch Review: Select Commits to View |
Scope the diff to all commits, a single commit, or any subset. |
Branch Review: Exclude Commits from View |
Leave specific commits out of the diff; everything else stays. |
Review progress
| Command |
Description |
Branch Review: Toggle Reviewed (Selected Lines) |
Mark/unmark the selected lines as reviewed (Ctrl+Alt+R). |
Branch Review: Mark All Files as Viewed |
Check every file's Viewed box. |
Branch Review: Next Unviewed File |
Open the next file you haven't marked as viewed. |
Branch Review: Next / Previous Change (Hunk) |
Walk hunk-to-hunk across every changed file (Ctrl+Alt+N / Ctrl+Alt+P). |
Branch Review: Mark Review Checkpoint |
Record "reviewed as of here" for interdiff. |
Branch Review: Toggle Changes Since Checkpoint |
Show only what changed after the checkpoint, diffed against it. |
Branch Review: Reset Review Progress (This Branch) |
Clear all viewed/reviewed state for the branch. |
Comments & AI Review
| Command |
Description |
Branch Review: Export Review (Markdown) |
Export the AI summary + all comment threads as markdown (clipboard or file). |
Branch Review: Delete All Review Comments (This Branch) |
Remove every comment thread on the branch. |
Branch Review: Review Changed Files with AI |
Summary + verdict, then parallel per-file review; findings become inline comment threads. |
Branch Review: Review Selected File(s) with AI |
Run an AI review scoped to the selected file(s)/folder (right-click). |
Branch Review: Show AI Review Summary |
Open the branch summary, walkthrough, and verdict from the last AI run. |
Apply Suggested Fix (on an AI thread) |
Apply the AI's suggested code change to the file. |
Branch Review: Apply All Suggested Fixes |
Apply every pending AI fix at once (anchors re-verified first). |
Branch Review: Run Local Checks |
Instant no-AI findings: secrets, conflict markers, debug leftovers, new TODOs. |
Branch Review: Check Review Gate |
Pass/fail on open findings at or above branchReview.gate.severity. |
Branch Review: Generate PR Title & Description (AI) |
AI-written PR title + body from the branch's diffs; copy, open, or gh pr create. |
Branch Review: Set / Clear Anthropic API Key |
Store or remove your API key in VS Code's SecretStorage. |
Branch Review: Delete AI Review Comments (This Branch) |
Remove only the AI-generated threads, keeping your own. |
Branch Review: Post Review to GitHub PR |
Post inline review comments or a single summary comment on the branch's PR (confirmation required). |
Settings
| Setting |
Default |
Description |
branchReview.baseBranch |
"" |
Base branch to compare against. Empty = auto-detect. |
branchReview.candidateBaseBranches |
["main","master","develop","trunk"] |
Branch names tried during auto-detection, in order. |
branchReview.ai.provider |
"auto" |
"auto" (API key → Copilot models → CLI), "anthropic", "claudeCode", or "vscodeLm". |
branchReview.ai.model |
"" |
Model override: an Anthropic model id, or a family/id for VS Code language models. Empty = provider default. |
branchReview.ai.maxFiles |
50 |
Threshold above which AI Review asks whether to review all changed files or just the first batch. |
branchReview.ai.mode |
"standard" |
"quick" (diff-only), "standard", or "thorough" (cross-file diffs in every prompt). |
branchReview.ai.verifyFindings |
true |
Second AI pass that re-checks findings and drops unconfirmed ones. |
branchReview.ai.summary |
true |
Generate the branch summary + verdict at the start of each run. |
branchReview.ai.concurrency |
4 |
Files reviewed in parallel (the CLI provider always runs one at a time). |
branchReview.ai.autoReviewOnCommit |
false |
Run an incremental AI review automatically after each commit. |
branchReview.ai.customInstructionsFile |
"" |
Repo-relative guidelines file. Empty = auto-detect .branchreview.md, .github/copilot-instructions.md, or CLAUDE.md. |
branchReview.ai.requestTimeout |
180 |
Seconds before a single AI request is abandoned, so a hung network/provider can never wedge the review. |
branchReview.ai.promptCaching |
true |
Cache the run-constant prompt prefix on providers that support it (Anthropic API). |
branchReview.ai.contextRequests |
true |
Let the AI request up to 3 other repo files for context before judging a change. |
branchReview.localChecks |
true |
Run the instant, deterministic checks (secrets, conflict markers, debug leftovers) with every AI review. |
branchReview.gate.severity |
"issue" |
Review gate threshold: "off", "issue", or "bug". |
AI Review setup
Run Branch Review: Review Changed Files with AI — if no provider is configured yet you'll be walked through the options:
- VS Code language models (Copilot) — zero setup. If GitHub Copilot is installed and signed in, Branch Review uses its models through the official VS Code Language Model API. No key, no extra account.
- Anthropic API key — run
Branch Review: Set Anthropic API Key and paste a key from your Anthropic account. Stored in VS Code's SecretStorage; never written to disk, settings, or git.
- Claude Code CLI — if you already have Claude Code installed and signed in, set
branchReview.ai.provider to "claudeCode" and reviews run against your existing subscription with no API key needed.
Findings appear as local comment threads (author 🤖 Claude (AI Review)) that you resolve, minimize, delete, reply to, or Apply Suggested Fix on — nothing is sent anywhere else until you explicitly run Branch Review: Post Review to GitHub PR, which posts the exported markdown (summary included) as a single PR comment via gh after a confirmation prompt.
Team review guidelines
Create a .branchreview.md at the repo root (committable, so the whole team reviews by the same rules):
- Follow our error-handling convention: never swallow exceptions silently.
- Public API changes must update the CHANGELOG.
- In src/api/**, all handlers must validate input with zod.
If it doesn't exist, .github/copilot-instructions.md or CLAUDE.md is used automatically.
How it works
The extension uses the built-in vscode.git extension API: it resolves the base branch, computes git merge-base <base> HEAD, and lists the files that differ between that merge-base and your working tree. Each file opens with vscode.diff, where the left side is the base version (via the git: content provider) and the right side is your live file.
License
MIT
| |