claude-code - 💡(How to fix) Fix [DOCS] Worktrees guide still says EnterWorktree branches from the default branch [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#56156Fetched 2026-05-05 05:56:43
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3
RAW_BUFFERClick to expand / collapse

Documentation Type

Incorrect/outdated documentation

Documentation Location

https://code.claude.com/docs/en/worktrees

Section/Topic

"Start Claude in a worktree" and "Choose the base branch"

Current Documentation

The docs currently say:

You can also ask Claude to "work in a worktree" during a session, and it will create one with the EnterWorktree tool.

Worktrees branch from your default branch: origin/HEAD if the repository has a remote, otherwise the current local HEAD. The origin/HEAD reference is stored in your local .git directory and was set when you cloned.

What's Wrong or Missing?

This is outdated for EnterWorktree after v2.1.128. The release changed EnterWorktree to create the new branch from the current local HEAD instead of the repository default branch, so local unpushed commits are preserved.

The current worktrees page introduces EnterWorktree and then immediately states that worktrees branch from origin/HEAD / the default branch. That gives readers the wrong mental model for what happens when they ask Claude to move the current session into a worktree.

Suggested Improvement

Update the base-branch guidance to call out EnterWorktree explicitly.

Suggested fix:

  • State that EnterWorktree creates the new worktree branch from the current local HEAD as of v2.1.128.
  • Mention that this preserves local, unpushed commits in the starting state.
  • If claude --worktree still follows different base-branch rules, document that separately instead of using one shared paragraph for both flows.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageLine(s)Context
https://code.claude.com/docs/en/worktrees45, 53-65The page says asking Claude to work in a worktree uses EnterWorktree, then describes default-branch / origin/HEAD behavior as the base-branch rule

Total scope: 1 page affected

Version context: Behavior changed in v2.1.128.

extent analysis

TL;DR

Update the documentation for "Start Claude in a worktree" and "Choose the base branch" to reflect that EnterWorktree creates a new worktree branch from the current local HEAD as of v2.1.128.

Guidance

  • Review the affected page (https://code.claude.com/docs/en/worktrees) and update the sections that describe the behavior of EnterWorktree to match the new functionality.
  • Clarify that EnterWorktree preserves local, unpushed commits in the starting state.
  • Consider documenting the behavior of claude --worktree separately if it follows different base-branch rules.
  • Verify the changes by checking the documentation for accuracy and ensuring that it correctly describes the behavior of EnterWorktree and claude --worktree.

Example

No code snippet is necessary for this issue, as it is a documentation update.

Notes

The update should only be applied to the affected page, and the version context should be considered to ensure that the documentation is accurate for different versions of the software.

Recommendation

Apply the suggested fix to update the documentation, as it will improve the accuracy and clarity of the documentation for users.

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