Skip to content

open

Opens or switches to a tmux window for a pre-existing git worktree. If the window already exists, switches to it. If not, creates a new window with the configured pane layout and environment. Accepts multiple names to open several worktrees at once.

bash
workmux open [name...] [flags]

Arguments

  • [name...]: One or more worktree names (the directory name, which is also the tmux window name without the prefix). Optional with --new when run from inside a worktree.

Options

FlagDescription
-n, --newForce opening in a new window even if one already exists. Creates a duplicate window with a suffix (e.g., -2, -3). Useful for having multiple terminal views into the same worktree. Cannot be combined with --session.
-s, --sessionOpen in session mode, overriding the stored mode. Persists the mode change for subsequent opens. Cannot be combined with --new. Only supported with tmux.
--run-hooksRe-runs the post_create commands (these block window creation).
--force-filesRe-applies file copy/symlink operations. Useful for restoring a deleted .env file.
-p, --prompt <text>Provide an inline prompt for AI agent panes.
-P, --prompt-file <path>Provide a path to a file containing the prompt.
-c, --continueResume the agent's most recent conversation in this worktree. Injects the appropriate flag for the configured agent (e.g., --continue for Claude, --resume for Gemini).
-e, --prompt-editorOpen your editor to write the prompt interactively.
--prompt-file-onlyWrite the prompt file to the worktree without injecting it into agent commands.

What happens

  1. Verifies that a worktree with <name> exists.
  2. If a tmux window exists and --new is not set, switches to it.
  3. Otherwise, creates a new tmux window (with suffix if duplicating). If the worktree was originally created with --session, the window is recreated in its own session.
  4. (If specified) Runs file operations and post_create hooks.
  5. Sets up your configured tmux pane layout.
  6. Automatically switches your tmux client to the new window.

Examples

bash
# Open or switch to a window for an existing worktree
workmux open user-auth

# Force open a second window for the same worktree (creates user-auth-2)
workmux open user-auth --new

# Open a new window for the current worktree (run from within the worktree)
workmux open --new

# Open in session mode (converts from window mode if needed)
workmux open user-auth --session

# Resume the agent's last conversation
workmux open user-auth --continue

# Resume and send a follow-up prompt
workmux open user-auth --continue -p "Continue implementing the login flow"

# Open and re-run dependency installation
workmux open user-auth --run-hooks

# Open and restore configuration files
workmux open user-auth --force-files

# Open multiple worktrees at once
workmux open user-auth api-refactor bugfix-login

Released under the MIT License.