PR comparison widget shows stale diff counter when comparing same branch

Resolved 💬 4 comments Opened Feb 12, 2026 by Mathias-Xuviate Closed Feb 12, 2026

Description

The branch comparison / PR creation widget in the Claude Code input area shows a stale diff counter (+20 -2744) even when:

  • Both sides of the comparison are the same branch (main ← main)
  • The working tree is clean (git status shows no changes)
  • Local and remote are in sync (git diff origin/main..main is empty)
  • There are no other branches in the repository

The counter does not clear after committing, pushing, or restarting the Claude Code session.

Steps to reproduce

  1. Have a repo with a single branch (main), fully pushed, clean working tree
  2. Open Claude Code in the project directory
  3. Observe the main ← main comparison widget showing a non-zero diff counter

Expected behaviour

When comparing the same branch to itself with no uncommitted changes, the counter should show +0 -0 or the widget should be hidden entirely.

Possible cause

The repository was recently renamed from master to main. The counter may be cached from a previous comparison between the two branches before master was deleted. Alternatively, untracked files (even gitignored ones) may have been included in the diff calculation.

Environment

  • Claude Code CLI (Opus 4.6)
  • Windows 11, Git for Windows
  • Single-branch repo, no PRs, no CI/CD

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗