Skip to content

Worktrees

worktree spawn popup

The sidebar can create a git worktree, open a new tmux window, and launch an agent in it — all from one keystroke. Closing lets you pick the scope: tear down the window, worktree, and branch together, or keep the worktree/branch on disk and only close the window.

Opened with n or by clicking the + button next to a repo header.

KeyAction
Text keysType the name. The slugified form (add login formadd-login-form) becomes both the tmux window name and the branch suffix (branch: agent/add-login-form). See “What gets created” below.
/ / Tab / Shift+TabMove focus between NAME / AGENT / MODE fields
/ Cycle the value when the agent or mode field has focus
EnterCreate the worktree + window and launch the agent
Esc / click outsideCancel

The modal’s NAME field is slugified (lowercase, non-alphanumeric → -) and reused as:

  • Branch<prefix><slug>, where <prefix> defaults to agent/ (e.g. add login formagent/add-login-form). Colliding slugs get an incrementing suffix (-2, -3, …).
  • Worktree path<parent>/<repo-name>-worktrees/<slug>, a sibling directory of the repo.
  • tmux window — the slug is used as the window name; the agent you picked in the modal (claude / codex / opencode) launches inside it with the selected permission MODE.

Defaults for the agent and branch prefix live in tmux options — see tmux options for the full list.

Opened with x on a spawn-created pane, or by clicking the × button next to the branch name.

KeyAction
y / EnterClose the tmux window, remove the git worktree (--force), and delete the branch the spawn created (git branch -D)
cClose the tmux window only, keep the worktree and branch on disk
n / EscCancel

Spawn-created branches are auto-generated under the agent/ prefix for short-lived explorations, and the close modal opts into git branch -D so it works even when the branch has not been merged upstream. Recover via git reflog if you delete one by mistake.

Worktree lifecycle tracking is Claude-only today — it needs the WorktreeCreate / WorktreeRemove hooks, which Codex and OpenCode do not emit.