[BUG] Session branch created even when "main" is explicitly selected as base branch (Claude Code desktop )
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?
Description:
When starting a session in Claude Code desktop , I explicitly select the repository and the main branch on the start screen (the repo picker shows the repo and branch before starting).
Despite that, the session automatically creates and works on a new system-generated branch (e.g. claude/some-generated-name), instead of committing directly to the main branch I selected. This isn't surfaced anywhere in the UI — I only found out because I looked for a file I'd just committed directly on main on GitHub and couldn't find it, since it had gone to a separate branch without my knowledge.
Actual behavior: the branch selection on the start screen seems to have no effect — the system always creates its own branch per session, regardless of the user's choice, with no warning.
What Should Happen?
Expected behavior: if I select main as the working branch, the commit should go to main, or the UI should clearly indicate that an intermediate branch will be created and that a manual merge/PR will be required afterward.
Error Messages/Logs
Steps to Reproduce
Go to Claude Code desktop and start a new session.
In the repo picker, select an existing repository and explicitly select its default branch (e.g. main) as the base/working branch.
Send a prompt asking Claude to make and commit a code change (e.g. "add a new file foo.txt with some content and commit it").
Let Claude commit and push the change.
Go to the repository on GitHub and check the main branch — the commit is not there.
Check the repository's branch list instead — a new branch was created (e.g. claude/<generated-name>) and the commit landed there, even though main was the branch selected in step 2.
Note: The UI gives no indication at any point that a separate branch will be created instead of the one selected — the commit appears to silently go to a system-generated branch regardless of the base branch choice.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.26832.0
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
This bug is on the Claude Code desktop app, not the CLI — the Platform/OS/Terminal fields above don't fully apply since branch selection happens in the app's session picker UI, not a terminal, but the form requires an answer.