Skip to content

The switch command jumps to a worktree's tmux session. If you are already inside tmux, it switches the client. If you are outside tmux, it attaches to the session.

Usage

bash
owt switch <name>

Alias: owt s

Arguments

ArgumentDescription
nameWorktree name, branch name, or partial match

Name Resolution

The switch command supports flexible name matching:

  • Full worktree name: add-auth
  • Full branch name: feature/add-auth
  • Partial match: auth (if unique among worktrees)

If a partial match is ambiguous, an error is shown with all matching worktrees.

Examples

Switch to a Worktree

bash
owt switch add-auth

Using Branch Name

bash
owt switch feature/add-auth

Partial Match

bash
# If "auth" uniquely matches one worktree
owt switch auth

Behavior

Inside tmux

When you are already in a tmux session (e.g., another worktree or the Control Plane), owt switch uses tmux switch-client to move you to the target session without detaching.

Outside tmux

When called from a regular terminal, owt switch attaches to the target worktree's tmux session. Detach with Ctrl+B, D to return to your terminal.

Error Handling

Worktree Not Found

Error: Worktree 'nonexistent' not found

Check available worktrees with owt list.

Ambiguous Name

Error: Multiple worktrees match 'auth':
  - feature/add-auth
  - bugfix/auth-issue

Use a more specific name to disambiguate.

See Also