[BUG] Worktree status bar shows diff against default branch instead of selected parent branch

Resolved 💬 5 comments Opened Apr 21, 2026 by TasukuMatsuura Closed May 27, 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?

When a worktree is created with a non-default parent branch, the status bar at the bottom of the Claude Code UI shows the diff against the repository's default branch (main) instead of the user-selected parent branch. The "Create PR" button's default base target also appears to be main rather than the selected parent.

The displayed diff numbers exactly match git diff --stat main...HEAD, which confirms the UI is computing the diff against main and ignoring the selected parent branch.

This likely shares the same root cause as #48200 (which reports the same symptom in the code review panel) but manifests in a different UI element — the status bar / Create-PR bar.

What Should Happen?

The status bar should show the diff against the user-selected parent branch (not the repository's default branch).

For example, when a worktree is created at the same HEAD as the selected parent branch, the status bar should display +0 -0 rather than the diff vs main. The "Create PR" button should also default to targeting the selected parent branch as the base.

Error Messages/Logs

Steps to Reproduce

  1. In a repo whose default branch is main, have a feature branch (e.g. feature/parent-branch) that has diverged from main by some commits.
  2. In Claude Code, create a new worktree session and explicitly select feature/parent-branch as the parent branch (not the default main).
  3. The worktree is created at the same HEAD as feature/parent-branch.
  4. Observe the status bar at the bottom of the Claude Code UI.

Expected: status bar shows feature/parent-branch ← claude/<worktree-name> +0 -0
Actual: status bar shows main ← claude/<worktree-name> +214 -2004

Verification with CLI:

$ git worktree list
<parent-worktree-path>      <SHA> [feature/parent-branch]
<claude-worktree-path>      <SHA> [claude/<worktree-name>]

$ git merge-base HEAD feature/parent-branch
<SHA>   # equals HEAD → real diff vs parent is 0

$ git diff --stat feature/parent-branch...HEAD
(empty — zero diff, as expected)

$ git diff --stat main...HEAD | tail -1
5 files changed, 214 insertions(+), 2004 deletions(-)   # matches UI display

### Claude Model

Opus

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

Claude 1.3561.0 (fbc74b) 2026-04-20T14:59:51.000Z

### Platform

Anthropic API

### Operating System

Windows

### Terminal/Shell

Windows Terminal

### Additional Information

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗