--worktree (-w) flag silently ignored when feature flag tengu_worktree_mode is not rolled out to user

Resolved 💬 2 comments Opened Feb 23, 2026 by michaelschleiss Closed Feb 23, 2026

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

  1. Have an account where tengu_worktree_mode is not in the GrowthBook rollout
  2. Run claude -w test (or claude --worktree test)
  3. Observe: no worktree created, no error, session starts in main repo

Verification: Check ~/.claude/.claude.json (or $CLAUDE_CONFIG_DIR/.claude.json) → cachedGrowthBookFeaturestengu_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 --worktree flag should work for all users (it's documented and in --help)
  • OR if it's behind a rollout, claude -w should 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=1 was 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗