claude-code - 💡(How to fix) Fix [DOCS] EnterWorktree mid-session worktree switching not documented in worktrees guide

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…

Code Example

### Switch between worktrees mid-session

If you have multiple worktrees open in parallel, you can switch from one to another without
returning to the main checkout first. Ask Claude to switch into another worktree by name or path:

"Switch to the worktree at .claude/worktrees/bugfix-123"

Claude calls `EnterWorktree` with a `path` to switch directly into the target worktree.
This works from within any existing Claude-managed worktree, from the main checkout,
or from a manually created worktree.
RAW_BUFFERClick to expand / collapse

Documentation Type

Missing documentation (feature not documented)

Documentation Location

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

Section/Topic

The worktrees guide — no section currently covers switching between existing Claude-managed worktrees mid-session.

Current Documentation

The worktrees guide describes creating and entering a single worktree:

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

The tools reference mentions the path parameter:

Pass a path to switch into an existing worktree of the current repository instead of creating a new one.

The ExitWorktree tool description says it "Exits a worktree session and returns to the original directory."

Nowhere in the worktrees guide is it documented that EnterWorktree can be called from within an existing Claude-managed worktree to switch directly to another worktree, bypassing the need to call ExitWorktree first.

What's Wrong or Missing?

As of v2.1.157, EnterWorktree can switch between Claude-managed worktrees mid-session. A user working in worktree A can now call EnterWorktree with a path to switch directly into worktree B, without first exiting back to the main checkout.

The worktrees guide — the primary documentation page for worktree usage — does not cover this workflow at all. The guide frames worktree entry as a one-time action (enter from main, then exit back to main), when in practice users with multiple parallel worktrees benefit from direct switching.

Suggested Improvement

Add a section to the worktrees guide documenting the mid-session switching workflow. Suggested content:

Add after "Start Claude in a worktree" (after line 35 in current mirror):

### Switch between worktrees mid-session

If you have multiple worktrees open in parallel, you can switch from one to another without
returning to the main checkout first. Ask Claude to switch into another worktree by name or path:

"Switch to the worktree at .claude/worktrees/bugfix-123"

Claude calls `EnterWorktree` with a `path` to switch directly into the target worktree.
This works from within any existing Claude-managed worktree, from the main checkout,
or from a manually created worktree.

Also update the ExitWorktree tool reference to clarify that it returns to the directory from which the session was originally launched, not necessarily the previous worktree.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageContext
https://code.claude.com/docs/en/worktreesPrimary worktree documentation — should describe mid-session switching workflow
https://code.claude.com/docs/en/tools-referenceEnterWorktree description mentions path parameter but doesn't explicitly state it works from within another worktree

Total scope: 2 pages affected (1 requires workflow documentation, 1 could benefit from clarification)

v2.1.157 changelog entry: "EnterWorktree can now switch between Claude-managed worktrees mid-session"

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 [DOCS] EnterWorktree mid-session worktree switching not documented in worktrees guide