[BUG] Diff button compares against `origin/master` instead of local branch point
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?
In a new Claude Code session using a worktree branched off local master, the diff button shows changes from origin/master...HEAD rather than master...HEAD. This causes the diff view to include commits that exist on local master but have not yet been pushed to the remote — changes completely unrelated to the current session.
What Should Happen?
The diff button should show changes introduced in the current worktree branch relative to the local branch it was created from (master...HEAD), returning no changes if Claude has not yet modified anything.
Actual Behavior
The diff button shows changes from origin/master...HEAD, which includes unpushed commits from local master that are unrelated to the current session.
Verification
git diff master...HEADreturns nothing (correct — no session changes)git diff origin/master...HEADmatches what the diff button displays
Environment
- Claude Code: latest
- Session type: new worktree session branched from local
master
Error Messages/Logs
Steps to Reproduce
- Have a local
masterbranch that is ahead oforigin/master(i.e. unpushed commits exist) - Start a new Claude Code session using a worktree branched off local
master - Without Claude making any changes, click the Diff button
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.1062.0 (b81bcd) Claude for Windows
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗