You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Add --worktree / -w startup flag to V2 #48272
Create or select a named worktree when the user supplies a name.
Generate a worktree name when the user omits the value.
Start the session with that worktree as its working directory.
Keep session history, file state, tools, and MCP state isolated from sessions in other worktrees.
Reuse the existing V2 worktree and workspace infrastructure.
This supports parallel tasks without manual worktree setup or extra terminal tabs. It also gives Claude Code users an equivalent to its -w workflow.
This request differs from #36048. That issue requests worktree subcommands and in-session switching with stash-based state management. This issue requests a startup flag for a one-command isolated session.
Thanks for the request, and for linking the earlier ones! You're asking for a --worktree [name] / -w startup flag in V2. It would create or select a git worktree (generating a name if you don't give one) and start the TUI session in it, so each parallel task gets its own sessions and state from a single command.
Right now V2 can only create worktrees from inside the TUI, using the Worktrees dialog or by moving a prompt to a new worktree. The default opencode command has no worktree flag. A plugin can't add this either, because plugins load after the CLI has read its flags and chosen the session's directory.
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the request, and for linking the earlier ones! You're asking for a
--worktree [name]/-wstartup flag in V2. It would create or select a git worktree (generating a name if you don't give one) and start the TUI session in it, so each parallel task gets its own sessions and state from a single command.Right now V2 can only create worktrees from inside the TUI, using the Worktrees dialog or by moving a prompt to a new worktree. The default
opencodecommand has no worktree flag. A plugin can't add this either, because plugins load after the CLI has read its flags and chosen the session's directory.Maintainers will consider it. Related issues:
--worktree/-wCLI flag request (closed after inactivity)-wrequest (closed after inactivity)opencode.jsonc