[FEATURE] Allow Claude Code Web to start sessions from branches other than default branch

Open 💬 57 comments Opened Oct 21, 2025 by mathiaswillburger

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Currently, Claude Code Web can only start coding sessions from the default branch. This becomes a limitation for individuals and teams using structured workflows like GitFlow or other multi-branch strategies. In such cases, the main branch is often several commits or even releases behind the develop branch or active feature branches.
As a result, Claude Code Web lacks access to the most recent context, dependencies, and code changes that are relevant to ongoing development work.

Proposed Solution

Allow users to select which branch Claude Code Web should start from before initiating a coding session.
This could be implemented through a branch selector in the session start dialog.

Alternative Solutions

_No response_

Priority

High - Significant impact on productivity

Feature Category

Other

Use Case Example

In many modern development workflows, it is common for multiple branches to be active simultaneously, each addressing different aspects of the project:

  • A feature/payments-integration branch may introduce new API endpoints and transaction logic that are not yet part of the main codebase. Starting Claude Code Web from this branch would ensure access to the most relevant feature-specific context.
  • A hotfix/login-timeout branch might exist to resolve an urgent production issue. Starting from this branch allows work to proceed against the stable production code without interference from ongoing development changes.
  • A develop branch often contains general updates, dependency upgrades, and integrated work from multiple contributors. Starting Claude Code Web from this branch would provide an up-to-date view of the project’s development status before releasing.

The ability to start Claude Code Web from any of these branches would make it easier to maintain accurate context and deliver more relevant code assistance across concurrent development efforts.

Additional Context

This capability would represent a competitive advantage over GitHub Copilot agents directly on github.com, where users have been requesting similar functionality (starting from non-main branches) for a long time — but it still hasn’t been implemented properly and only with workarounds.

View original on GitHub ↗

57 Comments

thiwa8 · 8 months ago

Sooo important. So core. Otherwise I love it

scottdavidcraig · 8 months ago

+1 I came here to request this feature

mrestrepoj10 · 8 months ago

+1

jwjordan · 8 months ago

+1

gjmorris · 8 months ago

+1. Claude code web is not useable for me without this.

capa1904 · 8 months ago

I'm looking forward to selecting a branch, too! So far, you may want to specify the branch in the prompt. Not nice, but at least a workaround.

gjmorris · 8 months ago

Claude does not seem to consistently honor instructions in the prompt to use a particular branch. I regularly end up with some flavor of the following:

  • I Prefix my Claude Code web prompt with _"Check out the branch at origin/<feature_branch> -- everything below must be in this branch."_
  • Claude starts with _"Bash: git fetch origin <feature_branch>"_ which looks good, and then implements changes. When I open a pull request to merge those changes, it defaults to main as the base branch. I edit the PR to change the base branch to be <feature_branch> then see merge conflicts, even though no commits to the feature branch have been made in the mean time.
  • When asking Claude why, it will tell me something like: _"I found the issue! The branch claude/fix-bla-bla-XXX was pre-created based on commit XXX, but the target branch <feature_branch> is 15 commits ahead at XXX. Your changes are based on an outdated version of the codebase. The files we modified exist in <feature_branch> but our branch diverged before those commits were added. Let me rebase our changes onto the correct base branch: ..."_

It will figure it out eventually but this is quite a cumbersome workflow.

As part of this feature request, the Create / Update PR button in the UI should also set the base branch to the feature branch specified.

adenaufal · 8 months ago

+1

achapla · 8 months ago

+1111111

yanik-anmut · 8 months ago

+1

martinholovsky · 8 months ago

+1

choff5507 · 8 months ago

+1

fgsoap · 8 months ago

+1

nolandubeau · 8 months ago

+1

stevenx · 8 months ago

+1

byjpr · 8 months ago

+1

llkj11 · 8 months ago

+1

A very important feature that's keeping me from using Claude Code Web where it would be otherwise useful.

ifarai · 8 months ago

This is critical. I do not believe Claude code mobile app or web is very useful without it. Codex already has this.

kianbazza · 8 months ago

+1

amenonegames · 8 months ago

+1

jareditteam · 8 months ago

+1

JBloss1517 · 8 months ago

Without this feature, I'm finding myself reaching for Codex web on actual work projects just so that I may do proper branching practices.

BrandonJF · 8 months ago

+1

nicklamont · 7 months ago

+1

gjmorris · 7 months ago

Still running into issues asking Claude Code Web to use a particular branch. Recent examples:

----

Initial prompt:

Switch to branch existing-feature-branch. [actual prompt for work to be done on top of the existing feature followed]

Claude response:

Bash git checkout existing-feature-branch Exit code 1 error: pathspec 'existing-feature-branch' did not match any file(s) known to git`

The existing-feature-branch did exist with commits not yet merged to main. At this point it seemed Claude had already created it's own claude/existing-feature-branch-ABCD branch (from main, not my feature branch as requested), told itself it's already on the right branch, and then started to look for the feature functionality I described. That functionality of course doesn't exist, because Claude created it's branch from main. After wasting a load of tokens investigating, it told me the base feature wasn't implemented yet and hallucinated a solution to my prompt on top of that non-existent feature. Dead end.

----

Initial prompt:

Everything below refers to the functionality committed to branch existing-feature-branch. Switch to that branch. Do not proceed until you are on the branch existing-feature-branch, it is already on the remote [actual prompt for work to be done on top of the existing feature followed]

This went better initially -- Claude response:

Bash: git fetch origin existing-feature-branch From http://127.0.0.1:51661/git/user/repo branch existing-feature-branch -> FETCH_HEAD [new branch] existing-feature-branch -> origin/existing-feature-branch ... Bash: git checkout existing-feature-branch branch 'existing-feature-branch' set up to track 'origin/existing-feature-branch'. Switched to a new branch 'existing-feature-branch'

Then after some iteration, Claude attempted to commit, and things went awry:

Now let me commit and push the changes: ... Bash: git checkout -b claude/new-feature-branch-DEFG Exit code 128 fatal: a branch named 'claude/new-feature-branch-DEFG' already exists ... Bash: git checkout claude/new-feature-branch-DEFG Exit code 1 error: Your local changes to the following files would be overwritten by checkout: ... Please commit your changes or stash them before you switch branches. Aborting ... Bash: git stash push -m "DESCRIPTION" Saved working directory and index state On existing-feature-branch: DESCRIPTION Bash: git checkout claude/new-feature-branch-DEFG && git stash pop Exit code 1 Switched to branch 'claude/new-feature-branch-DEFG' CONFLICT [multiple...] Unmerged paths: ... ...

Claude was able to resolve and commit, but the branch was then from main, and when I was unable to create a mergeable PR into existing-feature-branch and asked why it tells me:

Good catch! The issue is that claude/new-feature-branch-DEFG was not created from existing-feature-branch. Here's what happened: The branch claude/new-feature-branch-DEFG already existed when I tried to create it When I switched to it and applied my stashed changes, Git reported conflicts: "deleted by us" for all the XXX files This means those files don't exist in the claude/new-feature-branch-DEFG branch - they were created as "new files" when I committed The branch was likely created from main or another earlier branch that predates the XXX feature.

It then went on to delete, re-create the branch from the correct existing-feature-branch, and re-apply all changes.

This is very messy and inefficient. I hope native support for having Claude Code Web work in branches can be implemented soon. It's a major downside compared to working with Claude in the CLI. Codex on the web implements this well already.

navalh · 7 months ago

+1 million, really need to be able to choose the branch with Claude Code Web

RasberryKai · 7 months ago

+1

sylvansys · 7 months ago

+1

edgarjc · 7 months ago

+1

manzurola · 7 months ago

+1

willemdebeijer · 7 months ago

+1

nmarcofernandess · 7 months ago

Anthropic gave me $1,000 in credits when Claude Code Web launched. I was hyped.
Then I realized I could only start sessions from main.
I work on feat/* → dev → stage → main. Like every professional team using GitFlow. The feature I’m actively developing doesn’t exist in main — it won’t exist there for weeks or months.
So I opened Claude Code Web, looked at my main branch (which has zero context about what I’m actually building), closed it, and went back to my local workflow.
Credits used: $0.01 🤡
This isn’t an edge case. This is how software development works. Please prioritize this

conroy9068 · 7 months ago

+1

artjom-mashanin · 7 months ago

+1
This would be massive! Allowing to continue your work even on the go!

paradoux · 7 months ago

+1

s-JoL · 7 months ago

+1

tushar-innovalabs · 7 months ago

we earlier waiting for this

homomorfism · 7 months ago

+1

brandonbPM · 7 months ago

+1 Just tried for the first time. Magical aha moment for me, then realized it clones main and I can't select a branch... magic still there, but reduced by 50%.

mathiaswillburger · 6 months ago

I wonder what is so hard to achieve that? Does anybody have an idea whats the challenge?

HarryVu176 · 6 months ago

+999

tomjones · 6 months ago

+1

forkrul · 6 months ago

+1

RasberryKai · 6 months ago

+1

kristjaningi · 6 months ago

+1

corticalstack · 6 months ago

+1, breaks use of code web UI without explicit branch selection

piperdaniel1 · 6 months ago

+1

dev-lukian · 6 months ago

+1

DrDave · 5 months ago

+1

pnils08 · 5 months ago

So you choose a branch and it ignores it ? Let me guess you code with this extension as well. What branch has your code to make this work ?

cubs818 · 5 months ago

+1

klijakub · 4 months ago

I have the same problem

I can't force claude to use proper branch, always starting from main

AndreyMay · 3 months ago

+1

timurdv-skeldar · 3 months ago

+1

rkever2 · 3 months ago

+1

yurukusa · 3 months ago

Until the Web UI adds branch selection, here are alternatives:
Workaround 1 — Use the CLI with branch checkout:

git checkout develop
claude

The CLI always works on your current branch. If you primarily use the Web UI for convenience, consider the CLI for branch-specific work.
Workaround 2 — Use Remote Control from CLI:
Start a CLI session on the desired branch and control it from your phone/browser:

git checkout develop
claude

Remote Control gives you mobile/browser access to a CLI session that's already on the correct branch.
Workaround 3 — Use a worktree:

git worktree add ../project-develop develop
cd ../project-develop
claude

This gives you a separate working directory on the develop branch without affecting your main checkout.
Workaround 4 — SessionStart hook to verify branch:
If you want to ensure you're always starting on the right branch:

{
  "hooks": {
    "SessionStart": [
      {
        "hook": "bash -c 'BRANCH=$(git branch --show-current 2>/dev/null); echo \"Current branch: $BRANCH\" >&2; if [ \"$BRANCH\" = \"main\" ]; then echo \"WARNING: You are on main. Switch to develop if needed.\" >&2; fi'"
      }
    ]
  }
}
ben-matd · 1 month ago

Found a workaround, just ask Claude to switch to the desired branch.

Apparently it has the capability it's just that there's no UI for us to do it directly.