PR comparison widget shows stale diff counter when comparing same branch
Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Feb 12, 2026 · 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
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
https://github.com/anthropics/claude-code/issues/20478 seems to be a similar issue, but it was also closed as duplicate / I would upvote the actual open one
Closing as duplicate of #18541 (diff counter includes read files, not just changed files). That explains the inflated +20 -2744 we see -- Claude read many files during the session that were not actually modified. Upvoted #18541.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.