claude-code - 💡(How to fix) Fix [BUG] Desktop startup git branch selector misleading - defaults to main

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When starting a new session in Claude Code in the desktop app, the UI allows you to select a project and then offers a branch selector (and worktree option). The branch selector defaults to main even if there is a different branch checked out locally. once starting the session via a message, the startup process obviously calls git status and then updates the branch information in the session. This default to main behaviour is confusing UX. It makes the user think they are going to be working on main branch and if they don't spot the subtle update of the branch information post message then there could be confusing outcomes.

What Should Happen?

Claude Code should probably call a git status for the project directory on project select and update the default branch information before the first message is sent. Either that or have a clearer message that main may not be the effective branch and then a much clearer message if the subsequent branch that is initialised is different from the one selected at startup.

Error Messages/Logs

Steps to Reproduce

  1. Open Claude Code Desktop
  2. Start new session

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

n/a

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

No response

extent analysis

TL;DR

The default branch in Claude Code's UI should be updated to reflect the locally checked-out branch before starting a new session.

Guidance

  • Call git status for the project directory when a project is selected to determine the current branch.
  • Update the default branch information in the UI before sending the first message.
  • Consider adding a clearer message to indicate that the selected branch may not be the effective branch.
  • If the subsequent branch initialized is different from the one selected at startup, display a clear notification to avoid confusing outcomes.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a specific example.

Notes

The issue lacks information about the current implementation and version of Claude Code, which might be necessary to provide a more detailed solution.

Recommendation

Apply a workaround by modifying the UI to call git status and update the default branch information before starting a new session, as this seems to be the most straightforward way to address the confusing UX issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING