[BUG] Desktop app top-bar diff stat shows stale +N -0 after git reset --hard to remote (recurrence of #36364)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet (recently) — related prior report #36364 was auto-closed by the stale-bot for inactivity, not resolved on the merits; at least two other users (
jlarapr,lkolek) confirmed the same symptom there before it closed. - [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
The desktop app's top-bar widget (repo name + branch + +N -0 diff stat + "Create PR" button) displays a stale, nonzero diff count even when the local branch is byte-for-byte identical to its remote tracking branch.
Environment:
- Claude Code Desktop app, macOS (Darwin 25.5.0)
- App version:
1.17377.2 - Model: Sonnet 5
Steps to reproduce:
- Have a local branch (
main) diverge fromorigin/main— e.g. 1 local-only commit, while upstream has several commits not present locally. - Sync it:
git fetch origin && git reset --hard origin/main. - Confirm there's truly no diff:
````
git status # clean, no tracked changes
git diff origin/main # empty
git rev-parse HEAD origin/main # identical hashes
- Look at the desktop app's top bar.
What Should Happen?
The top bar should show +0 -0 (or hide the diff stat / "Create PR" button entirely), since HEAD exactly matches origin/main.
Actual Behavior
The top bar still shows +11 -0 and offers an active "Create PR" button, despite git confirming zero diff anywhere.
Notes
Same failure mode reported in #36364 (stale branch/diff tracker persisting even after full sync, and surviving app restarts) — that issue was closed by the stale-bot for inactivity, not because it was fixed or deemed invalid. Filing fresh since the underlying bug still reproduces on a current build, with a different trigger (reset --hard rather than a merge).