claude-code - 💡(How to fix) Fix Worktree dialog: selecting branch before checking "create worktree" reverts branch to default [1 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#54945Fetched 2026-05-01 05:50:19
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Fix Action

Fix / Workaround

Workaround: Check the worktree checkbox first, then select the branch.

RAW_BUFFERClick to expand / collapse

In the worktree creation dialog, if you select a non-default branch first and then check the "create worktree" checkbox afterwards, the branch selection silently reverts to the repository's default branch.

Steps to reproduce:

  1. Open the worktree/branch selection dialog
  2. Select a non-default branch
  3. Check the "create worktree" checkbox

Expected: Selected branch is preserved. Actual: Branch selection resets to the default branch.

Workaround: Check the worktree checkbox first, then select the branch.

extent analysis

TL;DR

Check the "create worktree" checkbox before selecting a non-default branch to preserve the branch selection.

Guidance

  • The issue seems to be related to the order of operations in the worktree creation dialog, where checking the "create worktree" checkbox after selecting a branch causes the branch selection to reset.
  • To verify the issue, follow the provided steps to reproduce and observe the branch selection behavior.
  • As a workaround, check the "create worktree" checkbox before selecting a non-default branch, as mentioned in the issue.
  • This workaround suggests that the issue might be related to the state or event handling of the dialog, where the checkbox check event is triggering a reset of the branch selection.

Example

No code snippet is provided as the issue seems to be related to the UI behavior and not a specific code implementation.

Notes

The provided workaround suggests a potential solution, but the underlying cause of the issue is not explicitly stated. The issue might be related to the dialog's event handling or state management.

Recommendation

Apply workaround: Checking the "create worktree" checkbox before selecting a non-default branch is a simple and effective way to preserve the branch selection, as it avoids the branch reset 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