[BUG] --worktree (-w) flag silently ignored due to server-side feature flag not rolled out
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?
claude -w (or claude --worktree <name>) silently does nothing — no worktree is created, no error is shown, and the session starts in the main repo as if -w was never passed.
This occurs on every repository I've tested (two completely unrelated repos, one with submodules and one without). Manual git worktree add works fine in both.
What Should Happen?
claude -w test should create a worktree and start the session inside it, as documented. If worktree creation fails or is unsupported for some reason, an error message should be shown.
Error Messages/Logs
No error messages — that's the problem. The flag is silently ignored with no output.
Steps to Reproduce
- Run
claude -w testin any git repository - Inside the session, run
pwdandgit worktree list - Observe: no worktree created, session is in the main repo, no error shown
What I've investigated so far:
Running strings on the compiled binary (v2.1.50) revealed what appears to be the --worktree option gated behind an internal flag called tengu_worktree_mode. The startup code appears to check this flag and, if it evaluates to false, set the worktree option to undefined — silently ignoring -w.
This flag was not present in my cachedGrowthBookFeatures in .claude.json. When I manually added "tengu_worktree_mode": true to that object, claude -w started working correctly.
Note: This analysis is based on examining strings in a compiled/minified binary, so the exact mechanism may differ from what I've described. The observable facts are:
-wsilently does nothing out of the box- Adding
"tengu_worktree_mode": truetocachedGrowthBookFeaturesin.claude.jsonfixes it
Claude Model
Opus
Is this a regression?
No, this never worked
Claude Code Version
2.1.50 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Xterm
Additional Information
- Tested on Ubuntu 24.04, zsh
- Two unrelated repos tested — same result
- Manual
git worktree addworks fine - Related silent worktree failures (different root causes): #27150, #27466
---
This issue was investigated using Claude Code, which performed the binary analysis via strings and identified the workaround.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗