Branch Review
A VS Code extension that provides a GitHub-style diff view for reviewing all changes on your branch - both committed and uncommitted - against any base branch.

Features
- Unified Diff View: See all changes on your branch (committed + uncommitted) in one comprehensive view
- Smart Comparison: Shows only your branch's changes, avoiding unrelated commits from the base branch
- AI-Powered Code Review: AI can analyze your changes and provide inline comments with suggestions and improvements
- Interactive Comments: Add, edit, and delete comments on any line (including AI-generated comments)
- Line Selection: Select single lines or ranges to comment on specific code blocks
- File Tree Sidebar: Collapsible sidebar showing all changed files with quick navigation and file statistics
- Enhanced Search: Find text across all file diffs and file paths with keyboard navigation (
Ctrl+F
/Cmd+F
)
- Smart Branch Switching: Easily switch between different base branches with search and keyboard navigation
- File Navigation: Click file names to open them directly in VS Code
- Copy File Names: Copy file paths to clipboard with visual feedback
- Review Export: Generate formatted review output for sharing or documentation
How It Works
The extension provides a unified comparison view that:
- Compares your branch with the selected base branch (usually
main
)
- Shows all changes including both committed and uncommitted changes (including untracked files)
- Marks uncommitted changes with visual indicators for clarity
- Provides clean diff view focused on your branch's work
- Enables AI analysis through MCP server integration for automated code review
This gives you a complete picture of all the work on your branch in a simple, unified interface.
Usage
- Start Review: Press
Cmd+Shift+R
(Mac) or Ctrl+Shift+R
(Windows/Linux)
- Select Base Branch: Click the branch dropdown to compare against different branches
- Review All Changes: See both committed and uncommitted changes in one unified view
- Add Comments: Click the
+
button next to any line or select multiple lines
- Search Code: Press
Ctrl+F
to search across all diffs
- Export Review: Click "Submit Review to Chat" to generate formatted output
AI Integration (Cursor Support)
Branch Review integrates with Cursor to provide AI-powered code reviews. The AI reads your files directly using git commands and automatically adds inline comments with suggestions, bug fixes, and improvements.
Setup Instructions
Enable MCP Server:
- Open VS Code settings (
Cmd+,
or Ctrl+,
)
- Search for "Branch Review MCP"
- Enable "Branch Review › MCP › Enabled" (enabled by default)
- The MCP server will automatically register with Cursor when you open a workspace
Start AI Review:
- Open Branch Review in VS Code (
Cmd+Shift+R
/ Ctrl+Shift+R
)
- In Cursor chat, type:
branch ai review
- The AI will get the branch comparison info and add inline comments
No manual configuration needed! The extension automatically registers the MCP server with Cursor using the Extension API.
Available AI Prompts
code_review
: Verification-first code review focused on maintainability over nitpicking
bug_finder
: Verification-first bug detection with emphasis on accuracy over speed
Troubleshooting
- "No tools found": Make sure MCP is enabled in settings ("Branch Review › MCP › Enabled")
- Commands not working: Ensure "Branch Review › MCP › Enabled" is checked in VS Code settings
- Server not registering: Try reloading the VS Code window to re-register the MCP server
- Multiple workspaces: Each workspace gets its own MCP server instance automatically
For detailed technical information, see AI_INTEGRATION.md.
Requirements
- VS Code 1.74.0+
- Git repository
- For AI features: Cursor IDE with MCP support
Development
For developers working on this extension:
Quick Start
npm install
npm test # Run all tests
npm run compile # Build the extension
License
MIT License