Base branch selector stuck on 'main' with "Unable to load branches" error
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
- Open a repository where the current branch's upstream is NOT
main
- Example: current branch
my-work, upstreamfeature/sql-migration
- Start a new chat in Claude Code Desktop
- Click the base branch dropdown at the top of the chat window
- 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
mainregardless 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-work → feature/sql-migration → main). 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
- Read the actual upstream from git config:
``bash`
git rev-parse --abbrev-ref --symbolic-full-name @{u}
origin/feature/sql-migration
This returns something like — use that as the default base instead of hardcoding main`.
- Graceful fallback chain when no upstream is set:
- Try
branch.<name>.mergefrom git config - Then try repo default:
git symbolic-ref refs/remotes/origin/HEAD - Only fall back to
mainas a last resort
- 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.)
- 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 -->
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗