claude-code - 💡(How to fix) Fix EnterWorktree tool creates worktrees inside .claude/ directory, breaking slash command and skill discovery [2 comments, 3 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#48967Fetched 2026-04-17 08:54:29
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2cross-referenced ×1

Root Cause

The EnterWorktree built-in tool creates new worktrees at .claude/worktrees/<name> instead of a project-standard location. This causes slash commands (/) and skills to fail to load in the resulting sessions, because Claude Code's command/skill discovery gets confused when the working directory is nested inside .claude/ itself.

Fix Action

Workaround

Manually create worktrees using git worktree add .worktrees/<name> -b <branch> instead of using EnterWorktree.

RAW_BUFFERClick to expand / collapse

Bug Description

The EnterWorktree built-in tool creates new worktrees at .claude/worktrees/<name> instead of a project-standard location. This causes slash commands (/) and skills to fail to load in the resulting sessions, because Claude Code's command/skill discovery gets confused when the working directory is nested inside .claude/ itself.

Steps to Reproduce

  1. Open a project in Claude Code desktop app
  2. Use the EnterWorktree tool (or have the AI use it) to create a new worktree session
  3. In the new session, type / — command autocomplete is empty or broken

Expected Behavior

Worktrees should be created at .worktrees/<name> (respecting the project's existing worktree directory convention) or at minimum outside .claude/. The .claude/ directory is Claude Code's own metadata folder — placing worktrees inside it causes the app to misidentify the project root.

Actual Behavior

Worktrees are created at .claude/worktrees/<name>. Sessions started from these worktrees have non-functional slash command autocomplete and skills don't load correctly.

Workaround

Manually create worktrees using git worktree add .worktrees/<name> -b <branch> instead of using EnterWorktree.

Environment

  • Platform: macOS (desktop app)
  • The issue is reproducible any time EnterWorktree is used

extent analysis

TL;DR

Update the EnterWorktree tool to create new worktrees at .worktrees/<name> instead of .claude/worktrees/<name> to fix the command autocomplete and skill loading issues.

Guidance

  • Verify the current worktree creation path by checking the EnterWorktree tool's configuration or implementation to understand why it defaults to .claude/worktrees/<name>.
  • Consider modifying the EnterWorktree tool to respect the project's existing worktree directory convention, which is .worktrees/<name>.
  • As a temporary workaround, use the manual git worktree add .worktrees/<name> -b <branch> command to create worktrees outside of the .claude/ directory.
  • Investigate how the command/skill discovery mechanism in Claude Code's desktop app can be updated to handle worktrees created inside .claude/ without breaking functionality.

Example

No code snippet is provided as the issue does not imply a specific code change, but rather a configuration or tooling adjustment.

Notes

The provided workaround using git worktree add suggests that the issue is specific to the EnterWorktree tool's behavior and not a fundamental limitation of the Claude Code app or Git.

Recommendation

Apply the workaround of manually creating worktrees using git worktree add .worktrees/<name> -b <branch> until the EnterWorktree tool is updated to create worktrees at the correct location. This approach ensures that command autocomplete and skills load correctly in new worktree sessions.

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 EnterWorktree tool creates worktrees inside .claude/ directory, breaking slash command and skill discovery [2 comments, 3 participants]