[BUG] Desktop app diff panel uses 'main' as base branch, ignoring origin/HEAD and GitHub default branch

Resolved 💬 0 comments Opened Jul 15, 2026 by hidenba Closed Jul 15, 2026

Environment

  • Claude Desktop app (Linux Beta): 1.20186.9
  • Claude Code: 2.1.209
  • OS: Arch Linux
  • Repo default branch (GitHub): stg

Description

The diff panel in the desktop app shows the diff against a branch named main, even though the repository's default branch is stg — both on GitHub and in the local origin/HEAD.

The docs state that the base branch is auto-detected from origin/HEAD (the remote default branch), but the panel appears to prefer a local branch named main when one exists.

Steps to reproduce

  1. Use a repository whose default branch is stg (GitHub default branch = stg, refs/remotes/origin/HEADrefs/remotes/origin/stg), while a local branch named main also exists (tracking a production branch).
  2. Open the project in the desktop app with stg checked out.
  3. Look at the diff panel.

Expected

Base branch is stg (from origin/HEAD / GitHub default branch), so the panel shows no diff (or only working-tree changes).

Actual

The panel header shows main → stg and lists the entire diff between the two branches (~1,500 files / 819 commits in our case), which makes the diff view unusable for repos that use a non-main default branch.

Verified on the affected machine:

$ git symbolic-ref refs/remotes/origin/HEAD
refs/remotes/origin/stg
$ gh api repos/<org>/<repo> --jq .default_branch
stg

(origin/HEAD has pointed to stg for months, so this is not a stale-cache-within-24h issue.)

Related

#23626 asks for a UI to pick the base branch; this issue is narrower: the documented auto-detection itself does not follow origin/HEAD.

View original on GitHub ↗