claude-code - 💡(How to fix) Fix PR base branch default should respect worktree base, not repo default [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#54942Fetched 2026-05-01 05:50:24
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1

Fix Action

Fix / Workaround

Workaround: Use gh pr create --base <branch> from the terminal instead.

RAW_BUFFERClick to expand / collapse

The "Create PR" button in the Claude Code UI defaults the base branch to the repository's default branch (e.g. master), regardless of which branch the current worktree was created from.

In workflows where feature work is done off a long-lived integration branch (e.g. feature/<something>) rather than master, this is misleading: the button shows a diff of ~110k lines (the full integration branch vs master) and would create a PR targeting the wrong base if clicked.

Expected: The button should default to the branch the current worktree/branch was created from (the merge-base or upstream tracking branch), not the repo's default branch.

Workaround: Use gh pr create --base <branch> from the terminal instead.

extent analysis

TL;DR

The "Create PR" button in the Claude Code UI should default to the branch the current worktree was created from, rather than the repository's default branch, to avoid incorrect PR targets.

Guidance

  • Identify the current worktree's base branch by checking the merge-base or upstream tracking branch.
  • Use the gh pr create --base <branch> command from the terminal as a temporary workaround to specify the correct base branch.
  • Consider modifying the UI to retrieve the current worktree's base branch and default to it when creating a PR.
  • Verify the correct base branch is used by checking the PR's target branch after creation.

Example

No code snippet is provided as it is not clearly supported by the issue.

Notes

This solution assumes that the gh pr create command is available and functional. The UI modification would require additional development and testing.

Recommendation

Apply workaround: using gh pr create --base <branch> from the terminal allows users to specify the correct base branch until a permanent fix is implemented in the UI.

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

claude-code - 💡(How to fix) Fix PR base branch default should respect worktree base, not repo default [1 comments, 2 participants]