Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>Compare Branch - Git Diff & PR PreviewNew to Visual Studio Code? Get it now.
Compare Branch - Git Diff & PR Preview

Compare Branch - Git Diff & PR Preview

Goodfoot Media LLC

| (0) | Free
Lightning-fast git branch comparison with tree view and auto-detection. Perfect for AI coding agents like Claude Code, GitHub Copilot, and Cursor. Streamline your PR workflow.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Lightning-fast git branch comparison with intelligent auto-detection and modern tree view. Perfect for AI coding agents like Claude Code, GitHub Copilot, and Cursor.

Visual Studio Marketplace Open VSX Registry Visual Studio Marketplace Downloads Visual Studio Marketplace Rating

Why Compare Branch?

Compare Branch is a performance-optimized VS Code extension designed for developers who need fast, focused branch comparison without the complexity of full-featured Git suites.

Perfect for:

  • 👨‍💻 PR Reviews - Preview your pull request changes before pushing
  • 🤖 AI Coding Agents - Review changes from Claude Code, GitHub Copilot, Cursor, Windsurf
  • 🌿 Feature Branch Development - Track all changes from your base branch
  • 🔍 Code Reviews - See exactly what changed in a clean tree view
  • ⚡ Large Repositories - Progressive loading keeps things fast

Compare Branch Demo


🤖 Built for AI Coding Workflows

Compare Branch is the essential companion for AI coding agents like Claude Code, GitHub Copilot, Cursor, and Windsurf.

Before Agent Execution:

  • 👀 Preview your baseline before handing off to an AI agent
  • 🎯 Verify the agent is working from the right foundation

After Agent Execution:

  • ✅ Instant PR preview of all agent-generated changes
  • 🔍 Review every file the agent modified before merging
  • ⚡ Fast iteration - spot issues immediately

During Development:

  • 🔄 Compare outputs from parallel agents on different branches
  • 📊 Understand the scope of agent modifications instantly

Pro tip: Keep Compare Branch open in your sidebar while agents work. When they finish, you'll instantly see all changes organized by directory—perfect for focused code review.


Features

⚡ Lightning-Fast Performance

  • Progressive loading for instant insights, even in large repositories
  • Optimized git operations with smart caching
  • Non-blocking activation - doesn't slow down VS Code startup

🧠 Intelligent Auto-Detection

  • Automatic upstream branch detection - no manual configuration needed
  • Smart branch tracking - automatically compares against your merge target
  • Manual override available when you need it

🌳 Modern Tree View

  • Hierarchical file display - see changes organized by directory
  • Git status decorations - visual indicators for added, modified, deleted files
  • Two view modes: Changed files only (default) or full file tree

🎯 Streamlined Workflow

  • Quick diff viewing - one click to see side-by-side comparisons
  • Drag-and-drop file operations - modern, intuitive interface
  • Multi-select support - work with multiple files at once
  • Context menu integration - all the actions you need

🔄 Auto-Refresh

  • File system monitoring - detects changes as you work
  • Git change tracking - updates when you switch branches or commit
  • Debounced updates - efficient, non-intrusive refreshing

Quick Start

  1. Open a git repository in VS Code
  2. Click the Compare Branch icon in the Activity Bar (left sidebar)
  3. View your changes - the extension auto-detects your upstream branch
  4. Click any file to see a detailed diff

That's it! The extension automatically compares your current branch against its upstream (e.g., main, develop).


Commands

Access via Command Palette (Cmd+Shift+P / Ctrl+Shift+P):

  • Compare Branch: Change Source Branch - Select a different branch to compare against
  • Compare Branch: Enable Auto-Detect Source Branch - Return to automatic upstream detection
  • Compare Branch: Refresh - Manually refresh the file list
  • Compare Branch: Switch to All Files Mode - Show complete file tree
  • Compare Branch: Switch to Changed Files Mode - Show only changed files

AI Agent Integrations

Works seamlessly with:

  • Claude Code - Terminal-based agentic coding
  • GitHub Copilot - Coding agent for pull requests
  • Cursor - AI-powered code editor
  • Windsurf - Collaborative AI coding
  • Cline (formerly Claude Dev) - VSCode AI assistant
  • Aider - AI pair programming in your terminal

Frequently Asked Questions

Q: Does this work with AI coding agents like Claude Code or Cursor? A: Absolutely! Compare Branch is specifically optimized for AI coding workflows. It's lightweight, provides instant PR previews, and auto-detects branches created by agents.

Q: How is this different from GitLens? A: Compare Branch is focused specifically on branch comparison with optimized performance. If you only need branch comparison, Compare Branch is faster and simpler. Think of it this way: if GitLens is a Swiss Army knife, Compare Branch is a laser-focused scalpel.

Q: Can I use this while an agent is working? A: Yes! Compare Branch is non-blocking and uses progressive loading. You can browse changes while agents run in the background.

Q: Does this work with large repositories? A: Yes! Progressive loading ensures the extension remains fast even with thousands of changed files.


Support & Resources

  • 📖 Documentation
  • 💬 GitHub Discussions
  • 🐛 Issue Tracker
  • 🔒 Security Policy
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft