CLI: --worktree (-w) flag silently ignored, no worktree created
Resolved 💬 2 comments Opened Feb 21, 2026 by andykreed Closed Feb 21, 2026
Bug
Running claude -w my-test --debug does not create a git worktree. The flag is silently ignored with no error or debug output.
Steps to reproduce
- Navigate to a git repository
- Run
claude -w my-test --debug - Observe that the session starts in the main repo directory
- Check
git worktree list— no new worktree was created - Check the debug log — zero worktree-related entries
Expected behavior
A new git worktree named my-test should be created and the session should run inside it.
Actual behavior
- The
-w my-testflag is silently ignored - The session runs in the main repo working directory
- The debug log contains no worktree-related processing at all — the flag appears to be parsed by Commander but never acted on
- No error message is shown to the user
Environment
- Claude Code version: 2.1.50
- Platform: macOS (Darwin 25.2.0)
- Node: v24.3.0
- Git worktrees are otherwise functional in the repo (existing worktrees work fine)
Debug log excerpt
The full debug log shows normal startup, MCP server connections, and tool usage — but zero references to "worktree", the name "my-test", or any git worktree commands being executed.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗