[BUG] Default worktree location inside repo causes major problems for react-native and other projects
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The core issue: EnterWorktree defaults to .claude/worktrees/<name> inside the repo, which creates a full duplicate of the project tree nested within itself. For any project with native tooling (React Native, iOS/Android builds, CocoaPods, Gradle), this causes silent, hard-to-diagnose build failures because:
Xcode can pick up duplicate source files or podspec references from the nested copy
CocoaPods resolves paths relative to the project root and may find the wrong Podfile
Watchman/Metro scans the entire tree and can serve files from the wrong location
Yoga/shadow view measurement (in your case) returned zero height for a native picker, likely because the build referenced the wrong copy of native module sources
The fact that it took hours of investigation to trace a "picker shows no content" bug back to the worktree nesting — and the fix was simply building from the main repo — shows how insidious this is.
The default .claude/worktrees/ location inside the repo is unsafe for projects with native build tooling.
My specific symptom: UIDatePicker countdown spinner invisible due to native module build confusion from nested duplicate project tree
What Should Happen?
A better default would be a sibling directory (e.g., ../<repo>-worktrees/<name>) or ~/.claude/worktrees/<repo>/<name>
Error Messages/Logs
Steps to Reproduce
- This would be almost impossible to reproduce IMO without my specific setup, as it is a very edge situation.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.49 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Using Claude Code desktop app.
I'm pretty sure previous versions of Claude Code created worktrees in ~/.claude by default. Not sure exactly which versions. That is a better default for this type of project.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗