[BUG] Claude Code Desktop app switches branch on new session after first interaction

Resolved 💬 3 comments Opened Mar 27, 2026 by breakbone-addons Closed May 4, 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?

After starting a new session, interacting with Claude the first time switches the selected branch.
Steps to reproduce:

  1. Open Claude
  2. Select folder and branch
  3. Ask clause what branch it's on
  4. The UI switches branch and Claude answers with the branch it just switched to.

When I asked Claude about it, the response was:
That sounds like a bug in Claude Code — selecting main in the branch picker, then the app switching itself to [branch] when the session starts. The reflog confirms the checkout to [branch] happened right at session start, not from anything you or I did.

You could report it at https://github.com/anthropics/claude-code/issues.

Want me to switch to main now?

What Should Happen?

The selected branch should be honored at session start.

Error Messages/Logs

Steps to Reproduce

Steps to reproduce:

  1. Open Claude
  2. Select folder and branch
  3. Ask clause what branch it's on
  4. The UI switches branch and Claude answers with the branch it just switched to.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

1.1.9134

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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