Base branch selector stuck on 'main' with "Unable to load branches" error

Resolved 💬 3 comments Opened Apr 9, 2026 by p134c0d3 Closed May 25, 2026

Summary

The base branch selector in the Claude Code Desktop chat starter is stuck on main and cannot be changed. When clicking the dropdown, it shows "Unable to load branches" and no alternatives are listed. This forces the diff comparison to use the wrong base for any workflow where main is not the immediate parent branch.

Environment

  • OS: macOS (Darwin 25.4.0)
  • Claude Code Desktop version: 1.1348.0
  • Git version: 2.53.0
  • Repository type: Monorepo with feature branches that branch off other feature branches (not main)

Steps to reproduce

  1. Open a repository where the current branch's upstream is NOT main
  • Example: current branch my-work, upstream feature/sql-migration
  1. Start a new chat in Claude Code Desktop
  2. Click the base branch dropdown at the top of the chat window
  3. Observe: dropdown shows "Unable to load branches" with no alternatives listed

Expected behavior

  • The base branch should default to the actual git upstream of the current branch, not a hardcoded main
  • The dropdown should list available branches (local + remote tracking)
  • Users should be able to select any branch as the base for diff comparison

Actual behavior

  • Base branch is hardcoded to main regardless of the real upstream
  • Dropdown shows "Unable to load branches" error
  • No way to override or change the base branch from the UI

Why this matters

On our team, main is never the base for active feature work. Feature branches routinely branch off other feature branches (e.g., my-workfeature/sql-migrationmain). When the base is hardcoded to main, the diff shown to Claude includes changes from the parent feature branch that aren't part of the current work — polluting context, wasting tokens, and producing confusing suggestions.

This isn't an edge case — it's standard stacked-PR / dependent-feature workflow used by many teams.

Suggested fixes

  1. Read the actual upstream from git config:

``bash
git rev-parse --abbrev-ref --symbolic-full-name @{u}
`
This returns something like
origin/feature/sql-migration — use that as the default base instead of hardcoding main`.

  1. Graceful fallback chain when no upstream is set:
  • Try branch.<name>.merge from git config
  • Then try repo default: git symbolic-ref refs/remotes/origin/HEAD
  • Only fall back to main as a last resort
  1. Surface the actual git error instead of the generic "Unable to load branches":
  • The underlying subprocess is failing silently
  • Show the real stderr so users can self-diagnose (permissions, missing refs, hung process, etc.)
  1. Let users manually pick any branch when auto-detection fails:
  • Dropdown should list local branches (git branch) as a fallback
  • Allow typing a branch name manually as a last resort

Screenshot

<!-- Screenshot to be added below -->

View original on GitHub ↗

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