--worktree (-w) flag silently ignored when feature flag tengu_worktree_mode is not rolled out to user
Description
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.
Root Cause
The --worktree flag is gated behind a GrowthBook feature flag tengu_worktree_mode that defaults to false:
function isWorktreeModeEnabled() { return AL("tengu_worktree_mode", false) }
// ...
worktreeOption = isWorktreeModeEnabled() ? opts.worktree : undefined
If the flag is not present in the user's cached GrowthBook features (or is not rolled out to them), -w is silently set to undefined and completely ignored.
Additionally, DISABLE_TELEMETRY=1 causes ALL feature flags to return their defaults (since GrowthBook sync is skipped), which also silently disables --worktree.
Steps to Reproduce
- Have an account where
tengu_worktree_modeis not in the GrowthBook rollout - Run
claude -w test(orclaude --worktree test) - Observe: no worktree created, no error, session starts in main repo
Verification: Check ~/.claude/.claude.json (or $CLAUDE_CONFIG_DIR/.claude.json) → cachedGrowthBookFeatures → tengu_worktree_mode is absent.
Workaround: Manually add "tengu_worktree_mode": true to cachedGrowthBookFeatures in .claude.json. This may be overwritten on next GrowthBook sync.
Expected Behavior
Either:
- The
--worktreeflag should work for all users (it's documented and in--help) - OR if it's behind a rollout,
claude -wshould print a clear error like "Worktree mode is not yet available for your account"
A documented CLI flag should never silently no-op.
Environment
- Claude Code v2.1.50
- Linux (Ubuntu 24.04)
- Tested on two unrelated repos (one with submodules, one without)
DISABLE_TELEMETRY=1was set (but issue persists even without it when flag isn't rolled out)
Additional Context
This same pattern likely affects other feature-flagged CLI features. There are ~66 feature flags in the binary gating various user-facing functionality. Users with DISABLE_TELEMETRY=1 get none of them.
Related: #27150, #27466 (other silent worktree failures)
---
Note: this analysis was performed using Claude Code.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗