[BUG] Diff button compares against `origin/master` instead of local branch point

Resolved 💬 1 comment Opened Apr 9, 2026 by dhvik Closed May 25, 2026

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...HEAD returns nothing (correct — no session changes)
  • git diff origin/master...HEAD matches what the diff button displays

Environment

  • Claude Code: latest
  • Session type: new worktree session branched from local master

Error Messages/Logs

Steps to Reproduce

  1. Have a local master branch that is ahead of origin/master (i.e. unpushed commits exist)
  2. Start a new Claude Code session using a worktree branched off local master
  3. 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_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗