[BUG] Desktop app shows massive incorrect diff for worktree branch at same commit as base
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The Claude Code desktop app shows a massive diff (+595,528 -28,470) in the PR creation bar for a worktree branch (claude/pensive-bhabha) that is at the exact same commit as master. The diff should be zero.
The UI shows master ← claude/pensive-bhabha with the large diff numbers and a "Create PR" button, even though both branches point to the same SHA (592dbf269).
Verified via CLI:
$ git rev-parse HEAD
592dbf269351c2314c227980ab554ddcc7bc868e
$ git rev-parse origin/master
592dbf269351c2314c227980ab554ddcc7bc868e
$ git diff origin/master --stat
(no output — zero diff)
The worktree branch has no remote tracking branch set, which may be relevant.
What Should Happen?
The diff should show +0 -0 (or hide the PR bar entirely) when the worktree branch is at the same commit as the base branch.
Error Messages/Logs
No errors — just incorrect diff numbers in the UI.
Steps to Reproduce
- Open Claude Code desktop app
- Start a conversation with
--worktree(or let it auto-create a worktree) - Do not make any changes — the worktree branch is created at the same commit as
master - Observe the PR creation bar at the top showing a massive diff
Claude Model
Opus
Is this a regression?
Not sure
Last Working Version
_No response_
Claude Code Version
Latest
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
The repo's default branch is master (not main). The worktree branch claude/pensive-bhabha has no upstream tracking branch set. The diff numbers (+595,528 -28,470) look like the entire repo contents being counted as new, suggesting the diff computation may be failing to find a common ancestor or is comparing against an empty tree.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗