The attach command hands you off to a worktree's agent session, hosted by whichever multiplexer backend that worktree was created with. By default it reads the recorded backend from the status database, so you do not need to repeat any backend flags.
Usage
owt attach <name> [OPTIONS]Arguments
| Argument | Description |
|---|---|
name | Worktree name (or matching identifier) of the session to attach to |
Options
| Option | Description |
|---|---|
--herdr | Force the herdr backend, overriding the recorded one |
--tmux | Force the tmux backend, overriding the recorded one |
Behavior
owt resolves the session from the status database. Each worktree records its backend at create-time (backend_kind, backend_session_id, and backend_meta, including the exact herdr socket for custom deployments), so a plain owt attach <name> always routes to the right surface:
- A worktree created with tmux attaches via tmux (
tmux attach). - A worktree created with
--herdrattaches via herdr (herdr agent attach <pane_id>), using the recorded socket.
Forcing a Backend
When you pass --tmux or --herdr and it differs from what was recorded, owt does not coerce the recorded session id (tmux session names and herdr pane ids are different shapes -- coercing would silently misroute). Instead it re-resolves the session via backend.session_for(name) on the forced backend.
If the forced backend has no session for that worktree, owt errors clearly rather than failing later in the attach handshake:
No herdr session for 'my-feature'. Recorded as tmux.Examples
Attach Using the Recorded Backend
owt attach my-featureForce herdr
owt attach my-feature --herdrForce tmux
owt attach my-feature --tmuxSee Also
- Multiplexer Backends -- tmux vs herdr, selection precedence, and per-worktree records
owt switch-- Jump between agent sessions from inside tmuxowt send-- Send a message to an agent session