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 statusshows no changes) - Local and remote are in sync (
git diff origin/main..mainis 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
- Have a repo with a single branch (
main), fully pushed, clean working tree - Open Claude Code in the project directory
- Observe the
main ← maincomparison 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
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗