[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-75764":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":9,"totalLinesOfCode":9,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":9,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":9,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},75764,"workmux","raine\u002Fworkmux","raine","git worktrees + tmux windows for zero-friction parallel dev",null,"https:\u002F\u002Fgithub.com\u002Fraine\u002Fworkmux","Rust",1612,117,7,12,0,25,40,147,75,19.22,false,"main","2026-06-12 02:03:35","\u003Cp align=\"center\">\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"meta\u002Flogo-dark.svg\">\n    \u003Cimg src=\"meta\u002Flogo.svg\" alt=\"workmux icon\" width=\"300\">\n  \u003C\u002Fpicture>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cstrong>Parallel development in tmux* with git worktrees\u003C\u002Fstrong>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fworkmux.raine.dev\u002F\">\u003Cstrong>📖 Documentation\u003C\u002Fstrong>\u003C\u002Fa> ·\n  \u003Ca href=\"#installation\">Install\u003C\u002Fa> ·\n  \u003Ca href=\"#quick-start\">Quick start\u003C\u002Fa> ·\n  \u003Ca href=\"#commands\">Commands\u003C\u002Fa> ·\n  \u003Ca href=\"CHANGELOG.md\">Changelog\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\nGiga opinionated zero-friction workflow tool for managing\n[git worktrees](https:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-worktree) and tmux windows as\nisolated development environments. Perfect for running multiple AI agents in\nparallel without conflict.\n\n**Philosophy**: Build on tools you already use. tmux\u002Fzellij\u002Fkitty\u002Fetc. for\nwindowing, git for worktrees, your agent for coding - workmux ties them together.\n\n\u003Csup>\u003Csub>\\* Also supports\n\u003Ca href=\"https:\u002F\u002Fworkmux.raine.dev\u002Fguide\u002Fkitty\">kitty\u003C\u002Fa>,\n\u003Ca href=\"https:\u002F\u002Fworkmux.raine.dev\u002Fguide\u002Fwezterm\">WezTerm\u003C\u002Fa>, and\n\u003Ca href=\"https:\u002F\u002Fworkmux.raine.dev\u002Fguide\u002Fzellij\">Zellij\u003C\u002Fa> as alternative\nbackends.\u003C\u002Fsub>\u003C\u002Fsup>\n\n📖 **New to workmux?** Read the\n[introduction blog post](https:\u002F\u002Fraine.dev\u002Fblog\u002Fintroduction-to-workmux\u002F) for a\nquick overview.\n\n![workmux screenshot](https:\u002F\u002Fraw.githubusercontent.com\u002Fraine\u002Fworkmux\u002Frefs\u002Fheads\u002Fmain\u002Fmeta\u002Fscreenshot_20260329_165534.webp)\n\n> [!TIP]\n> [consult-llm](https:\u002F\u002Fgithub.com\u002Fraine\u002Fconsult-llm) pairs naturally with\n> workmux: let your agents consult another AI model to plan architecture,\n> review changes, debate approaches, or get unstuck on tricky bugs without\n> leaving the worktree.\n>\n> See [How to orchestrate large coding tasks without context bloat](https:\u002F\u002Fraine.dev\u002Fblog\u002Fphased-implement-workflow\u002F)\n> for a workflow that combines workmux and consult-llm.\n\n## Why workmux?\n\n**Parallel workflows.** Work on multiple features the same time, each with its\nown AI agent. No stashing, no branch switching, no conflicts.\n\n**One window per task.** A natural mental model. Each has its own terminal\nstate, editor session, dev server, and AI agent. Context switching is switching\ntabs.\n\n**Automated setup.** New worktrees start broken (no `.env`, no `node_modules`,\nno dev server). workmux can copy config files, symlink dependencies, and run\ninstall commands on creation.\n\n**One-command cleanup.** `workmux merge` handles the full lifecycle: merge the\nbranch, delete the worktree, close the tmux window, remove the local branch.\n\n**Terminal workflow.** Build on your terminal setup instead of yet another\nagentic GUI that won't exist next year. If you don't have one yet, tmux might be\nworth picking up.\n\nNew to worktrees? See [Why git worktrees?](#why-git-worktrees)\n\n## Features\n\n- Create git worktrees with matching tmux windows in a single command (`add`)\n- Merge branches and clean up everything (worktree, tmux window, branches) in\n  one command (`merge`)\n- [Dashboard](#workmux-dashboard) for monitoring agents, reviewing changes, and\n  sending commands\n- [Sidebar](https:\u002F\u002Fworkmux.raine.dev\u002Fguide\u002Fsidebar\u002F) for a persistent,\n  at-a-glance view of all agents across tmux windows\n- [Delegate tasks to worktree agents](#delegating-tasks-with-worktree) with the\n  `\u002Fworktree` skill\n- [Display agent status in tmux window names](#agent-status-tracking)\n- Automatically set up your preferred tmux pane layout (editor, shell, watchers,\n  etc.)\n- Run post-creation hooks (install dependencies, setup database, etc.)\n- Copy or symlink configuration files (`.env`, `node_modules`) into new\n  worktrees\n- [Sandbox agents](#sandbox) in containers or VMs for enhanced security\n- [Automatic branch name generation](#automatic-branch-name-generation) from\n  prompts using LLM\n- Shell completions\n\n## Hype\n\n> \"I've been using (and loving) workmux which brings together tmux, git\n> worktrees, and CLI agents into an opinionated workflow.\"  \n> — @Coolin96 [🔗](https:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=46029809)\n\n> \"Thank you so much for your work with workmux! It's a tool I've been wanting\n> to exist for a long time.\"  \n> — @rstacruz [🔗](https:\u002F\u002Fgithub.com\u002Fraine\u002Fworkmux\u002Fissues\u002F2)\n\n> \"It's become my daily driver - the perfect level of abstraction over tmux +\n> git, without getting in the way or obscuring the underlying tooling.\"  \n> — @cisaacstern [🔗](https:\u002F\u002Fgithub.com\u002Fraine\u002Fworkmux\u002Fissues\u002F33)\n\n> \"I have to mention workmux at every opportunity because it's the perfect glue\n> between worktrees, agents and tmux windows.\"  \n> — @dedbrizz [🔗](https:\u002F\u002Fwww.threads.com\u002F@dedbrizz\u002Fpost\u002FDVt1DtLkr_l)\n\n## Installation\n\n### Bash YOLO\n\n```bash\ncurl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Fraine\u002Fworkmux\u002Fmain\u002Fscripts\u002Finstall.sh | bash\n```\n\n### Homebrew (macOS\u002FLinux)\n\n```bash\nbrew install raine\u002Fworkmux\u002Fworkmux\n```\n\n\u003Cdetails>\n\u003Csummary>Other methods (Cargo, mise, Nix)\u003C\u002Fsummary>\n\n**Cargo** (requires [rustup](https:\u002F\u002Frustup.rs\u002F)):\n\n```bash\ncargo install workmux\n```\n\n**mise:**\n\n```bash\nmise use -g cargo:raine\u002Fworkmux\n```\n\n**Nix** ([flake and home-manager setup](https:\u002F\u002Fworkmux.raine.dev\u002Fguide\u002Fnix)):\n\n```bash\nnix profile install github:raine\u002Fworkmux\n```\n\n\u003C\u002Fdetails>\n\n---\n\nFor manual installation, see\n[pre-built binaries](https:\u002F\u002Fgithub.com\u002Fraine\u002Fworkmux\u002Freleases\u002Flatest).\n\n## Quick start\n\n\u003C!-- prettier-ignore -->\n> [!NOTE]\n> workmux requires a terminal multiplexer. Make sure you have\n> [tmux](https:\u002F\u002Fgithub.com\u002Ftmux\u002Ftmux) (or\n> [WezTerm](https:\u002F\u002Fraine.github.io\u002Fworkmux\u002Fguide\u002Fwezterm) \u002F\n> [Kitty](https:\u002F\u002Fraine.github.io\u002Fworkmux\u002Fguide\u002Fkitty) \u002F\n> [Zellij](https:\u002F\u002Fraine.github.io\u002Fworkmux\u002Fguide\u002Fzellij)) installed and running\n> before you start. See [My tmux setup](https:\u002F\u002Fraine.dev\u002Fblog\u002Fmy-tmux-setup\u002F)\n> if you need a starting point.\n\n1. **Initialize configuration (optional)**:\n\n   ```bash\n   workmux init\n   ```\n\n   This creates a `.workmux.yaml` file to customize your workflow (pane layouts,\n   setup commands, file operations, etc.). workmux works out of the box with\n   sensible defaults, so this step is optional.\n\n2. **Create a new worktree and tmux window**:\n\n   ```bash\n   workmux add new-feature\n   ```\n\n   This will:\n   - Create a git worktree at\n     `\u003Cproject_root>\u002F..\u002F\u003Cproject_name>__worktrees\u002Fnew-feature`\n   - Copy config files and symlink dependencies (if\n     [configured](#file-operations))\n   - Run any [`post_create`](#lifecycle-hooks) setup commands\n   - Create a tmux window named `wm-new-feature` (the prefix is configurable)\n   - Set up your configured or the default tmux pane layout\n   - Automatically switch your tmux client to the new window\n\n3. **Do your thing**\n\n4. **Finish and clean up**\n\n   **Local merge:** Run `workmux merge` to merge into the base branch and clean\n   up in one step.\n\n   **PR workflow:** Push and open a PR. After it's merged, run `workmux remove`\n   to clean up.\n\n## Configuration\n\nworkmux uses a two-level configuration system:\n\n- **Global** (`~\u002F.config\u002Fworkmux\u002Fconfig.yaml`): Personal defaults for all\n  projects\n- **Project** (`.workmux.yaml`): Project-specific overrides\n\nProject settings override global settings. When you run workmux from a\nsubdirectory, it walks upward to find the nearest `.workmux.yaml`, allowing\nnested configs for monorepos. See the\n[Monorepos guide](https:\u002F\u002Fworkmux.raine.dev\u002Fguide\u002Fmonorepos#nested-configuration)\nfor details. For `post_create` and file operation lists (`files.copy`,\n`files.symlink`), you can use `\"\u003Cglobal>\"` to include global values alongside\nproject-specific ones. Other settings like `panes` are replaced entirely when\ndefined in the project config.\n\n### Global configuration example\n\n`~\u002F.config\u002Fworkmux\u002Fconfig.yaml`:\n\n```yaml\nnerdfont: true # Enable nerdfont icons (prompted on first run)\nmerge_strategy: rebase # Make workmux merge do rebase by default\nagent: claude\n\npanes:\n  - command: \u003Cagent> # Start the configured agent (e.g., claude)\n    focus: true\n  - split: horizontal # Second pane with default shell\n```\n\n### Project configuration example\n\n`.workmux.yaml`:\n\n```yaml\npost_create:\n  - '\u003Cglobal>'\n  - mise use\n\nfiles:\n  symlink:\n    - '\u003Cglobal>' # Include global symlinks (node_modules)\n    - .pnpm-store # Add project-specific symlink\n\npanes:\n  - command: pnpm install\n    focus: true\n  - command: \u003Cagent>\n    split: horizontal\n  - command: pnpm run dev\n    split: vertical\n```\n\nFor a real-world example, see\n[workmux's own `.workmux.yaml`](https:\u002F\u002Fgithub.com\u002Fraine\u002Fworkmux\u002Fblob\u002Fmain\u002F.workmux.yaml).\n\n### Configuration options\n\nMost options have sensible defaults. You only need to configure what you want to\ncustomize.\n\n#### Basic options\n\n| Option           | Description                                                                                           | Default                     |\n| ---------------- | ----------------------------------------------------------------------------------------------------- | --------------------------- |\n| `main_branch`    | Branch to merge into                                                                                  | Auto-detected               |\n| `base_branch`    | Default base branch for new worktrees                                                                 | Current branch              |\n| `worktree_dir`   | Directory for worktrees (absolute or relative). Supports `~` and `{project}`.                         | `\u003Cproject>__worktrees\u002F`     |\n| `window_prefix`  | Prefix for tmux window\u002Fsession names                                                                  | `wm-`                       |\n| `mode`           | Tmux mode (`window` or `session`)                                                                     | `window`                    |\n| `agent`          | Default agent for `\u003Cagent>` placeholder                                                               | `claude`                    |\n| `agents`         | Named agent commands ([docs](https:\u002F\u002Fworkmux.raine.dev\u002Fguide\u002Fagents#named-agents), global-only)       | `{}`                        |\n| `merge_strategy` | Default merge strategy (`merge`, `rebase`, `squash`)                                                  | `merge`                     |\n| `theme`          | Dashboard color scheme ([custom colors](https:\u002F\u002Fworkmux.raine.dev\u002Fguide\u002Fconfiguration#custom-colors)) | `default` (auto dark\u002Flight) |\n\n#### Naming options\n\n| Option            | Description                                 | Default |\n| ----------------- | ------------------------------------------- | ------- |\n| `worktree_naming` | How to derive names from branches           | `full`  |\n| `worktree_prefix` | Prefix for worktree directories and windows | none    |\n\n`worktree_naming` strategies:\n\n- `full`: Use the full branch name (slashes become dashes)\n- `basename`: Use only the part after the last `\u002F` (e.g., `prj-123\u002Ffeature` →\n  `feature`)\n\n#### Panes\n\nDefine your tmux pane layout with the `panes` array. For multiple windows in\nsession mode, use [`windows`](#multiple-windows-per-session) instead (they are\nmutually exclusive).\n\n```yaml\npanes:\n  - command: \u003Cagent>\n    focus: true\n  - command: npm run dev\n    split: horizontal\n    size: 15\n```\n\nEach pane supports:\n\n| Option       | Description                                                    | Default |\n| ------------ | -------------------------------------------------------------- | ------- |\n| `command`    | Command to run (see [agent placeholders](#agent-placeholders)) | Shell   |\n| `focus`      | Whether this pane receives focus                               | `false` |\n| `zoom`       | Zoom pane to fullscreen (implies `focus: true`)                | `false` |\n| `split`      | Split direction (`horizontal` or `vertical`)                   | —       |\n| `size`       | Absolute size in lines\u002Fcells                                   | 50%     |\n| `percentage` | Size as percentage (1-100)                                     | 50%     |\n\n##### Agent placeholders\n\n- `\u003Cagent>`: resolves to the configured agent (from `agent` config or `--agent`\n  flag)\n\nBuilt-in agents (`claude`, `gemini`, `codex`, `opencode`, `kiro-cli`, `vibe`,\n`pi`) are auto-detected when used as literal commands and receive prompt\ninjection automatically, without needing the `\u003Cagent>` placeholder or a matching\n`agent` config:\n\n```yaml\npanes:\n  - command: 'claude --dangerously-skip-permissions'\n    focus: true\n  - command: 'codex --yolo'\n    split: vertical\n```\n\nEach agent receives the prompt (via `-p`\u002F`-P`\u002F`-e`) using the correct format for\nthat agent. Auto-detection matches the executable name regardless of flags or\npath.\n\n#### Named layouts\n\nDefine reusable pane arrangements in the `layouts` map and select one at\nadd-time with `-l\u002F--layout`:\n\n```yaml\nlayouts:\n  design:\n    panes:\n      - command: \u003Cagent>\n        focus: true\n      - command: \u003Cagent:codex>\n        split: vertical\n  review:\n    panes:\n      - command: \u003Cagent>\n```\n\n```bash\nworkmux add my-feature -l design\n```\n\nWhen `-l` is used, the layout's `panes` replace the top-level `panes` for that\nworktree. All other config (hooks, files, agent, etc.) comes from the top-level\nas usual. The `-l` flag cannot be combined with `--agent`.\n\n#### File operations\n\nNew worktrees are clean checkouts with no gitignored files (`.env`,\n`node_modules`, etc.). Use `files` to automatically copy or symlink what each\nworktree needs:\n\n```yaml\nfiles:\n  copy:\n    - .env\n  symlink:\n    - .next\u002Fcache # Share build cache across worktrees\n```\n\nBoth `copy` and `symlink` accept glob patterns.\n\nTo re-apply file operations to an existing worktree (e.g., after updating the\nconfig), run `workmux sync-files` from inside the worktree. Use `--all` to sync\nall worktrees at once.\n\n#### Lifecycle hooks\n\nRun commands at specific points in the worktree lifecycle, such as installing\ndependencies or running database migrations. All hooks run with the **worktree\ndirectory** as the working directory (or the nested config directory for\n[nested configs](https:\u002F\u002Fworkmux.raine.dev\u002Fguide\u002Fmonorepos#nested-configuration))\nand receive environment variables: `WM_HANDLE`, `WM_WORKTREE_PATH`,\n`WM_PROJECT_ROOT`, `WM_CONFIG_DIR`.\n\n`WM_CONFIG_DIR` points to the directory containing the `.workmux.yaml` that was\nused, which may differ from `WM_WORKTREE_PATH` when using nested configs.\n\n| Hook          | When it runs                                      | Additional env vars                  |\n| ------------- | ------------------------------------------------- | ------------------------------------ |\n| `post_create` | After worktree creation, before tmux window opens | —                                    |\n| `pre_merge`   | Before merging (aborts on failure)                | `WM_BRANCH_NAME`, `WM_TARGET_BRANCH` |\n| `pre_remove`  | Before worktree removal (aborts on failure)       | —                                    |\n\nExample:\n\n```yaml\npost_create:\n  - direnv allow\n\npre_merge:\n  - just check\n```\n\n#### Agent status icons\n\nCustomize the icons shown in tmux window names:\n\n```yaml\nstatus_icons:\n  working: '🤖' # Agent is processing\n  waiting: '💬' # Agent needs input (auto-clears on focus)\n  done: '✅' # Agent finished (auto-clears on focus)\n```\n\nAgents in \"working\" status that produce no pane output for 10 seconds are\nautomatically detected as interrupted.\n\nSet `status_format: false` to disable automatic tmux format modification\n\n#### Default behavior\n\n- Worktrees are created in `\u003Cproject>__worktrees` as a sibling directory to your\n  project by default\n- If no `panes` configuration is defined, workmux provides opinionated defaults:\n  - For projects with a `CLAUDE.md` file: Opens the configured agent (see\n    `agent` option) in the first pane, defaulting to `claude` if none is set.\n  - For all other projects: Opens your default shell.\n  - Both configurations include a second pane split horizontally\n- `post_create` commands are optional and only run if you configure them\n\n### Automatic setup with panes\n\nUse the `panes` configuration to automate environment setup. Unlike\n`post_create` hooks which must finish before the tmux window opens, pane\ncommands execute immediately _within_ the new window.\n\nThis can be used for:\n\n- **Installing dependencies**: Run `npm install` or `cargo build` in a focused\n  pane to monitor progress.\n- **Starting services**: Launch dev servers, database containers, or file\n  watchers automatically.\n- **Running agents**: Initialize AI agents with specific context.\n\nSince these run in standard tmux panes, you can interact with them (check logs,\nrestart servers) just like a normal terminal session.\n\nRunning dependency installation (like `pnpm install`) in a pane command rather\nthan `post_create` has a key advantage: you get immediate access to the tmux\nwindow while installation runs in the background. With `post_create`, you'd have\nto wait for the install to complete before the window even opens. This also\nmeans AI agents can start working immediately in their pane while dependencies\ninstall in parallel.\n\n```yaml\npanes:\n  # Pane 1: Install dependencies, then start dev server\n  - command: pnpm install && pnpm run dev\n\n  # Pane 2: AI agent\n  - command: \u003Cagent>\n    split: horizontal\n    focus: true\n```\n\n### Directory structure\n\nHere's how workmux organizes your worktrees by default:\n\n```\n~\u002Fprojects\u002F\n├── my-project\u002F               \u003C-- Main project directory\n│   ├── src\u002F\n│   ├── package.json\n│   └── .workmux.yaml\n│\n└── my-project__worktrees\u002F    \u003C-- Worktrees created by workmux\n    ├── feature-A\u002F            \u003C-- Isolated workspace for 'feature-A' branch\n    │   ├── src\u002F\n    │   └── package.json\n    │\n    └── bugfix-B\u002F             \u003C-- Isolated workspace for 'bugfix-B' branch\n        ├── src\u002F\n        └── package.json\n```\n\nEach worktree is a separate working directory for a different branch, all\nsharing the same git repository. This allows you to work on multiple branches\nsimultaneously without conflicts.\n\nYou can customize the worktree directory location using the `worktree_dir`\nconfiguration option (see [Configuration options](#configuration-options)).\nThe value supports `~` for the home directory and a `{project}` placeholder\nthat resolves to the main worktree's directory name. This lets a single\nglobal config namespace every repo's worktrees under one root, e.g.\n`worktree_dir: ~\u002F.workmux\u002F{project}`.\n\n### Shell alias (recommended)\n\nFor faster typing, alias `workmux` to `wm`:\n\n```bash\nalias wm='workmux'\n```\n\n## Commands\n\n- [`add`](#workmux-add-branch-name) - Create a new worktree and tmux window\n- [`merge`](#workmux-merge-branch-name) - Merge a branch and clean up everything\n- [`remove`](#workmux-remove-name-alias-rm) - Remove worktrees without merging\n- [`list`](#workmux-list) - List all worktrees with status\n- [`open`](#workmux-open-name) - Open a tmux window for an existing worktree\n- [`close`](#workmux-close-name) - Close a worktree's tmux window (keeps\n  worktree)\n- [`resurrect`](#workmux-resurrect) - Restore worktree windows after a crash\n- [`path`](#workmux-path-name) - Get the filesystem path of a worktree\n- [`dashboard`](#workmux-dashboard) - Show TUI dashboard of all active agents\n- [`sidebar`](#workmux-sidebar) - Toggle a compact agent status sidebar in tmux\n- [`config edit`](#workmux-config-edit) - Edit the global configuration file\n- [`init`](#workmux-init) - Generate configuration file\n- [`sandbox`](#workmux-sandbox) - Manage sandbox backends (container\u002FLima)\n- [`claude prune`](#workmux-claude-prune) - Clean up stale Claude Code entries\n- [`completions`](#workmux-completions-shell) - Generate shell completions\n- [`docs`](#workmux-docs) - Show detailed documentation\n\n### `workmux add \u003Cbranch-name>`\n\nCreates a new git worktree with a matching tmux window and switches you to it\nimmediately. If the branch doesn't exist, it will be created automatically.\n\n- `\u003Cbranch-name>`: Name of the branch to create or switch to, a remote branch\n  reference (e.g., `origin\u002Ffeature-branch`), or a GitHub fork reference (e.g.,\n  `user:branch`). Remote and fork references are automatically fetched and\n  create a local branch with the derived name. Fork references derive the local\n  branch as `user-branch` (e.g., `someuser:feature` creates local branch\n  `someuser-feature`). Optional when using `--pr`.\n\n#### Options\n\n- `--base \u003Cbranch|commit|tag>`: Specify a base branch, commit, or tag to branch\n  from when creating a new branch. Overrides `base_branch` config. Defaults to\n  `base_branch` from config, then the currently checked out branch.\n- `--pr \u003Cnumber>`: Checkout a GitHub pull request by its number into a new\n  worktree.\n  - Requires the `gh` command-line tool to be installed and authenticated.\n  - The local branch name defaults to the PR's head branch name, but can be\n    overridden (e.g., `workmux add custom-name --pr 123`).\n  - If that local branch already exists and has no worktree, it is reused.\n- `-A, --auto-name`: Generate branch name from prompt using LLM. See\n  [Automatic branch name generation](#automatic-branch-name-generation).\n- `--name \u003Cname>`: Override the worktree directory and tmux window name. By\n  default, these are derived from the branch name (slugified). Cannot be used\n  with multi-worktree generation (`--count`, `--foreach`, or multiple\n  `--agent`).\n- `-b, --background`: Create the tmux window in the background without switching\n  to it. Useful with `--prompt-editor`.\n- `-w, --with-changes`: Move uncommitted changes from the current worktree to\n  the new worktree, then reset the original worktree to a clean state. Useful\n  when you've started working on main and want to move your branches to a new\n  worktree.\n- `--patch`: Interactively select which changes to move (requires\n  `--with-changes`). Opens an interactive prompt for selecting hunks to stash.\n- `-u, --include-untracked`: Also move untracked files (requires\n  `--with-changes`). By default, only staged and modified tracked files are\n  moved.\n- `-p, --prompt \u003Ctext>`: Provide an inline prompt that will be automatically\n  passed to AI agent panes.\n- `-P, --prompt-file \u003Cpath>`: Provide a path to a file whose contents will be\n  used as the prompt.\n- `-e, --prompt-editor`: Open your `$EDITOR` (or `$VISUAL`) to write the prompt\n  interactively.\n- `--prompt-file-only`: Write the prompt file to the worktree without injecting\n  it into agent commands. No agent pane is required. Useful when your editor has\n  an embedded agent that reads `.workmux\u002FPROMPT-*.md` directly.\n- `-l, --layout \u003Cname>`: Use a named pane layout from config instead of the\n  default panes. Cannot be combined with `--agent`.\n- `-a, --agent \u003Cname>`: The agent(s) to use for the worktree(s). Can be\n  specified multiple times to generate a worktree for each agent. Overrides the\n  `agent` from your config file.\n- `-W, --wait`: Block until the created tmux window is closed. Useful for\n  scripting when you want to wait for an agent to complete its work. The agent\n  can signal completion by running `workmux remove --keep-branch`.\n- `-o, --open-if-exists`: If a worktree for the branch already exists, open it\n  instead of failing. Similar to `tmux new-session -A`. Useful when you don't\n  know or care whether the worktree already exists.\n- `-s, --session`: Create a tmux session instead of a window. See\n  [Session mode](#session-mode) for details.\n- `--config \u003Cpath>`: Use an alternate config file for this invocation. Still\n  merges with global config.\n- `--fork`: Fork the last conversation from the current worktree into the new\n  one. The agent resumes with the forked conversation context. Use\n  `--fork=\u003Csession-id>` to fork a specific session (prefix matching supported).\n  Currently supports Claude Code.\n\n#### Skip options\n\nThese options allow you to skip expensive setup steps when they're not needed\n(e.g., for documentation-only changes):\n\n- `-H, --no-hooks`: Skip running `post_create` commands\n- `-F, --no-file-ops`: Skip file copy\u002Fsymlink operations (e.g., skip linking\n  `node_modules`)\n- `-C, --no-pane-cmds`: Skip executing pane commands (panes open with plain\n  shells instead)\n\n#### What happens\n\n1. Determines the **handle** for the worktree by slugifying the branch name\n   (e.g., `feature\u002Fauth` becomes `feature-auth`). This can be overridden with\n   the `--name` flag.\n2. Creates a git worktree at `\u003Cworktree_dir>\u002F\u003Chandle>` (the `worktree_dir` is\n   configurable and defaults to a sibling directory of your project)\n3. Runs any configured file operations (copy\u002Fsymlink)\n4. Executes `post_create` commands if defined (runs before the tmux window\n   opens, so keep them fast)\n5. Creates a new tmux window named `\u003Cwindow_prefix>\u003Chandle>` (e.g.,\n   `wm-feature-auth` with `window_prefix: wm-`)\n6. Sets up your configured tmux pane layout\n7. Automatically switches your tmux client to the new window\n\n#### Examples\n\n##### Basic usage\n\n```bash\n# Create a new branch and worktree\nworkmux add user-auth\n\n# Use an existing branch\nworkmux add existing-work\n\n# Create a new branch from a specific base\nworkmux add hotfix --base production\n\n# Create a worktree from a remote branch (creates local branch \"user-auth-pr\")\nworkmux add origin\u002Fuser-auth-pr\n\n# Remote branches with slashes work too (creates local branch \"feature\u002Ffoo\")\nworkmux add origin\u002Ffeature\u002Ffoo\n\n# Create a worktree in the background without switching to it\nworkmux add feature\u002Fparallel-task --background\n\n# Use a custom name for the worktree directory and tmux window\nworkmux add feature\u002Flong-descriptive-branch-name --name short\n\n# Open existing worktree if it exists, create if it doesn't (idempotent)\nworkmux add my-feature -o\n```\n\n##### Checking out pull requests and fork branches\n\n```bash\n# Checkout PR #123. The local branch will be named after the PR's branch.\nworkmux add --pr 123\n\n# Checkout PR #456 with a custom local branch name\nworkmux add fix\u002Fapi-bug --pr 456\n\n# Checkout a fork branch using GitHub's owner:branch format (copy from GitHub UI)\n# Creates local branch \"someuser-feature-branch\" tracking the fork\nworkmux add someuser:feature-branch\n```\n\n##### Moving changes to a new worktree\n\n```bash\n# Move uncommitted changes to a new worktree (including untracked files)\nworkmux add feature\u002Fnew-thing --with-changes -u\n\n# Move only staged\u002Fmodified files (not untracked files)\nworkmux add fix\u002Fbug --with-changes\n\n# Interactively select which changes to move\nworkmux add feature\u002Fpartial --with-changes --patch\n```\n\n##### AI agent prompts\n\n```bash\n# Create a worktree with an inline prompt for AI agents\nworkmux add feature\u002Fai --prompt \"Implement user authentication with OAuth\"\n\n# Override the default agent for a specific worktree\nworkmux add feature\u002Ftesting -a gemini\n\n# Create a worktree with a prompt from a file\nworkmux add feature\u002Frefactor --prompt-file task-description.md\n\n# Open your editor to write a prompt interactively\nworkmux add feature\u002Fnew-api --prompt-editor\n\n# Write prompt file only (for editors with embedded agents like neovim)\nworkmux add feature\u002Ftask -P task.md --prompt-file-only\n```\n\n##### Skipping setup steps\n\n```bash\n# Skip expensive setup for documentation-only changes\nworkmux add docs-update --no-hooks --no-file-ops --no-pane-cmds\n\n# Skip just the file operations (e.g., you don't need node_modules)\nworkmux add quick-fix --no-file-ops\n```\n\n##### Scripting with --wait\n\n```bash\n# Block until the agent completes and closes the window\nworkmux add feature\u002Fapi --wait -p \"Implement the REST API, then run: workmux remove --keep-branch\"\n\n# Use in a script to run sequential agent tasks\nfor task in task1.md task2.md task3.md; do\n  workmux add \"task-$(basename $task .md)\" --wait -P \"$task\"\ndone\n```\n\n#### AI agent integration\n\nWhen you provide a prompt via `--prompt`, `--prompt-file`, or `--prompt-editor`,\nworkmux automatically injects the prompt into panes running the configured agent\ncommand (e.g., `claude`, `codex`, `opencode`, `gemini`, `kiro-cli`, `vibe`,\n`pi`, or whatever you've set via the `agent` config or `--agent` flag) without\nrequiring any `.workmux.yaml` changes:\n\n- Panes with a command matching the configured agent are automatically started\n  with the given prompt.\n- You can keep your `.workmux.yaml` pane configuration simple (e.g.,\n  `panes: [{ command: \"\u003Cagent>\" }]`) and let workmux handle prompt injection at\n  runtime.\n\nThis means you can launch AI agents with task-specific prompts without modifying\nyour project configuration for each task.\n\nIf your editor has an embedded agent (e.g., neovim with an agent plugin), use\n`--prompt-file-only` to write the prompt to `.workmux\u002FPROMPT-\u003Cbranch>.md`\nwithout requiring an agent pane. Your editor can then detect and consume the\nfile on startup. This can also be set permanently in config with\n`prompt_file_only: true`.\n\n#### Automatic branch name generation\n\nThe `--auto-name` (`-A`) flag generates a branch name from your prompt using an\nLLM. The tool used depends on your configuration:\n\n1. `auto_name.command` is set: uses that command as-is\n2. `config.agent` is a known agent (`claude`, `gemini`, `codex`, `opencode`,\n   `kiro-cli`, `vibe`, `pi`): uses the agent's CLI with a fast\u002Fcheap model\n3. Neither: falls back to the [`llm`](https:\u002F\u002Fllm.datasette.io\u002F) CLI tool\n\n##### Usage\n\n```bash\n# Opens editor for prompt, generates branch name\nworkmux add -A\n\n# With inline prompt\nworkmux add -A -p \"Add OAuth authentication\"\n\n# With prompt file\nworkmux add -A -P task-spec.md\n```\n\n##### Requirements\n\nWhen `agent` is configured (e.g., `agent: claude`), workmux automatically uses\nthat agent's CLI for branch naming. No additional setup is required beyond\nhaving the agent installed.\n\nIf no agent is configured and no `auto_name.command` is set, workmux uses the\n`llm` CLI tool:\n\n```bash\npipx install llm\n```\n\nConfigure a model (e.g., OpenAI):\n\n```bash\nllm keys set openai\n# Or use a local model\nllm install llm-ollama\n```\n\nIf you set `auto_name.command`, `llm` is not required.\n\n##### Agent profile defaults\n\nWhen an agent is configured, these commands are used automatically:\n\n| Agent      | Auto-name command                                                        |\n| ---------- | ------------------------------------------------------------------------ |\n| `claude`   | `claude --model haiku -p`                                                |\n| `gemini`   | `gemini -m gemini-2.5-flash-lite -p`                                     |\n| `codex`    | `codex exec --config model_reasoning_effort=\"low\" -m gpt-5.1-codex-mini` |\n| `opencode` | `opencode run`                                                           |\n| `kiro-cli` | `kiro-cli chat --no-interactive`                                         |\n| `pi`       | `pi -p`                                                                  |\n\nTo override back to `llm` when an agent is configured, set\n`auto_name.command: \"llm\"`.\n\n##### Configuration\n\nOptionally configure auto-name behavior in `.workmux.yaml`:\n\n```yaml\nauto_name:\n  model: 'gemini-2.5-flash-lite'\n  background: true # Always run in background when using --auto-name\n  system_prompt: |\n    Generate a concise git branch name based on the task description.\n\n    Rules:\n    - Use kebab-case (lowercase with hyphens)\n    - Keep it short: 1-3 words, max 4 if necessary\n    - Focus on the core task\u002Ffeature, not implementation details\n    - No prefixes like feat\u002F, fix\u002F, chore\u002F\n\n    Examples of good branch names:\n    - \"Add dark mode toggle\" → dark-mode\n    - \"Fix the search results not showing\" → fix-search\n    - \"Refactor the authentication module\" → auth-refactor\n    - \"Add CSV export to reports\" → export-csv\n    - \"Shell completion is broken\" → shell-completion\n\n    Output ONLY the branch name, nothing else.\n```\n\nTo use a specific tool, set `auto_name.command`. The command string is split\ninto program and arguments, and the composed prompt is piped via stdin.\n\n```yaml\nauto_name:\n  command: 'claude -p'\n\n# Force llm even when an agent is configured\nauto_name:\n  command: 'llm'\n```\n\n| Option          | Description                                                      | Default                    |\n| --------------- | ---------------------------------------------------------------- | -------------------------- |\n| `command`       | Command for branch name generation (overrides agent profile)     | Agent profile or `llm` CLI |\n| `model`         | LLM model to use with the `llm` CLI (ignored when `command` set) | `llm`'s default            |\n| `background`    | Always run in background when using `--auto-name`                | `false`                    |\n| `system_prompt` | Custom system prompt for branch name generation                  | Built-in prompt            |\n\nRecommended models for fast, cheap branch name generation (with `llm`):\n\n- `gemini-2.5-flash-lite` (recommended)\n- `gpt-5-nano`\n\n#### Parallel workflows & multi-worktree generation\n\nworkmux can generate multiple worktrees from a single `add` command, which is\nideal for running parallel experiments or delegating tasks to multiple AI\nagents. This is controlled by four mutually exclusive modes:\n\n- (`-a`, `--agent`): Create a worktree for each specified agent.\n- (`-n`, `--count`): Create a specific number of worktrees.\n- (`--foreach`): Create worktrees based on a matrix of variables.\n- **stdin**: Pipe input lines to create worktrees with templated prompts.\n\nWhen using any of these modes, branch names are generated from a template, and\nprompts are templated with variables. Single-worktree prompts are passed through\nliterally, so common syntax like GitHub Actions `${{ ... }}` does not need to be\nescaped.\n\n##### Multi-worktree options\n\n- `-a, --agent \u003Cname>`: When used multiple times, creates one worktree for each\n  agent.\n- `-n, --count \u003Cnumber>`: Creates `\u003Cnumber>` worktree instances. Can be combined\n  with a single `--agent` flag to apply that agent to all instances.\n- `--foreach \u003Cmatrix>`: Creates worktrees from a variable matrix string. The\n  format is `\"var1:valA,valB;var2:valX,valY\"`. All value lists must have the\n  same length. Values are paired by index position (zip, not Cartesian product):\n  the first value of each variable goes together, the second with the second,\n  etc.\n- `--branch-template \u003Ctemplate>`: A\n  [MiniJinja](https:\u002F\u002Fdocs.rs\u002Fminijinja\u002Flatest\u002Fminijinja\u002F) (Jinja2-compatible)\n  template for generating branch names.\n  - Available variables: `{{ base_name }}`, `{{ agent }}`, `{{ num }}`,\n    `{{ index }}`, `{{ input }}` (stdin), and any variables from `--foreach`.\n  - Default:\n    `{{ base_name }}{% if agent %}-{{ agent | slugify }}{% endif %}{% for key, value in foreach_vars %}-{{ value | slugify }}{% endfor %}{% if num %}-{{ num }}{% endif %}`\n- `--max-concurrent \u003Cnumber>`: Limits how many worktrees run simultaneously.\n  When set, workmux creates up to `\u003Cnumber>` worktrees, then waits for any\n  window to close before starting the next. Requires agents to close windows\n  when done (e.g., via prompt instruction to run\n  `workmux remove --keep-branch`).\n\n##### Prompt templating\n\nWhen generating multiple worktrees, any prompt provided via `-p`, `-P`, or `-e`\nis treated as a MiniJinja template. You can use variables from your generation\nmode to create unique prompts for each agent or instance. For ordinary\nsingle-worktree `add` commands, prompt text is not templated.\n\n##### Variable matrices in prompt files\n\nInstead of passing `--foreach` on the command line, you can specify the variable\nmatrix directly in your prompt file using YAML frontmatter. This is more\nconvenient for complex matrices and keeps the variables close to the prompt that\nuses them.\n\n**Format:**\n\nCreate a prompt file with YAML frontmatter at the top, separated by `---`:\n\n**Example 1:** `mobile-task.md`\n\n```markdown\n---\nforeach:\n  platform: [iOS, Android]\n  lang: [swift, kotlin]\n---\n\nBuild a {{ platform }} app using {{ lang }}. Implement user authentication and\ndata persistence.\n```\n\n```bash\nworkmux add mobile-app --prompt-file mobile-task.md\n# Generates worktrees: mobile-app-ios-swift, mobile-app-android-kotlin\n```\n\n**Example 2:** `agent-task.md` (using `agent` as a foreach variable)\n\n```markdown\n---\nforeach:\n  agent: [claude, gemini]\n---\n\nImplement the dashboard refactor using your preferred approach.\n```\n\n```bash\nworkmux add refactor --prompt-file agent-task.md\n# Generates worktrees: refactor-claude, refactor-gemini\n```\n\n**Behavior:**\n\n- Variables from the frontmatter are available in both the prompt template and\n  the branch name template\n- All value lists must have the same length, and values are paired by index\n  position (same zip behavior as `--foreach`)\n- CLI `--foreach` overrides frontmatter with a warning if both are present\n- Works with both `--prompt-file` and `--prompt-editor`\n\n##### Stdin input\n\nYou can pipe input lines to `workmux add` to create multiple worktrees. Each\nline becomes available as the `{{ input }}` template variable in your prompt.\nThis is useful for batch-processing tasks from external sources.\n\n**Plain text:** Each line becomes `{{ input }}`\n\n```bash\necho -e \"api\\nauth\\ndatabase\" | workmux add refactor -P task.md\n# {{ input }} = \"api\", \"auth\", \"database\"\n```\n\n**JSON lines:** Each key becomes a template variable\n\n```bash\ngh repo list --json url,name --jq -c '.[]' | workmux add analyze \\\n  --branch-template '{{ base_name }}-{{ name }}' \\\n  -P prompt.md\n# Line: {\"url\":\"https:\u002F\u002Fgithub.com\u002Fraine\u002Fworkmux\",\"name\":\"workmux\"}\n# Variables: {{ url }}, {{ name }}, {{ input }} (raw JSON line)\n```\n\nThis lets you structure data upstream with `jq` and use meaningful branch names\nwhile keeping the full URL available in your prompt.\n\n**Behavior:**\n\n- Empty lines and whitespace-only lines are filtered out\n- Stdin input cannot be combined with `--foreach` (mutually exclusive)\n- JSON objects (lines starting with `{`) are parsed and each key becomes a\n  variable\n- `{{ input }}` always contains the raw line\n- If JSON contains an `input` key, it overwrites the raw line value\n\n##### Examples\n\n```bash\n# Create one worktree for claude and one for gemini with a focused prompt\nworkmux add my-feature -a claude -a gemini -p \"Implement the new search API integration\"\n# Generates worktrees: my-feature-claude, my-feature-gemini\n\n# Create 2 instances of the default agent\nworkmux add my-feature -n 2 -p \"Implement task #{{ num }} in TASKS.md\"\n# Generates worktrees: my-feature-1, my-feature-2\n\n# Create worktrees from a variable matrix\nworkmux add my-feature --foreach \"platform:iOS,Android\" -p \"Build for {{ platform }}\"\n# Generates worktrees: my-feature-ios, my-feature-android\n\n# Create agent-specific worktrees via --foreach\nworkmux add my-feature --foreach \"agent:claude,gemini\" -p \"Implement the dashboard refactor\"\n# Generates worktrees: my-feature-claude, my-feature-gemini\n\n# Use frontmatter in a prompt file for cleaner syntax\n# task.md contains:\n# ---\n# foreach:\n#   env: [staging, production]\n#   task: [smoke-tests, integration-tests]\n# ---\n# Run {{ task }} against the {{ env }} environment\nworkmux add testing --prompt-file task.md\n# Generates worktrees: testing-staging-smoke-tests, testing-production-integration-tests\n\n# Pipe input from stdin to create worktrees\n# review.md contains: Review the {{ input }} module for security issues.\necho -e \"auth\\npayments\\napi\" | workmux add review -A -P review.md\n# Generates worktrees with LLM-generated branch names for each module\n```\n\n##### Recipe: Batch processing with worker pools\n\nCombine stdin input, prompt templating, and concurrency limits to create a\nworker pool that processes items from an external command.\n\n**Example: Generate test scaffolding for untested files**\n\n```bash\n# generate-tests.md contains:\n# Read the file at {{ input }} and generate a test suite covering\n# the exported functions. Focus on happy path and edge cases.\n# When done, run: workmux remove --keep-branch\n\nfind src\u002Futils -name \"*.ts\" ! -name \"*.test.ts\" | \\\n  workmux add add-tests \\\n    --branch-template '{{ base_name }}-{{ index }}' \\\n    --prompt-file generate-tests.md \\\n    --max-concurrent 3 \\\n    --background\n```\n\n- `find ...` lists files without tests (one per line) piped to stdin\n- `--branch-template` uses `{{ index }}` for unique branch names\n- `--prompt-file` uses `{{ input }}` to pass each file path to the agent\n- `--max-concurrent 3` limits parallel agents to avoid rate limits\n- `--background` runs without switching focus\n\n---\n\n### `workmux merge [branch-name]`\n\nMerges a branch into a target branch (main by default) and automatically cleans\nup all associated resources (worktree, tmux window, and local branch).\n\n\u003C!-- prettier-ignore -->\n> [!TIP]\n> **`merge` vs `remove`**: Use `merge` when you want to merge directly\n> without a pull request. If your workflow uses pull requests, use\n> [`remove`](#workmux-remove-name-alias-rm) to clean up after your PR is merged\n> on the remote.\n\n- `[branch-name]`: Optional name of the branch to merge. If omitted,\n  automatically detects the current branch from the worktree you're in.\n\n#### Options\n\n- `--into \u003Cbranch>`: Merge into the specified branch instead of the main branch.\n  Useful for stacked PRs, git-flow workflows, or merging subtasks into a parent\n  feature branch. If the target branch has its own worktree, the merge happens\n  there; otherwise, the main worktree is used.\n- `--ignore-uncommitted`: Commit any staged changes before merging without\n  opening an editor\n- `--keep`, `-k`: Keep the worktree, window, and branch after merging (skip\n  cleanup). Useful when you want to verify the merge before cleaning up.\n- `--notification`: Show a system notification on successful merge. Useful when\n  delegating merge to an AI agent and you want to be notified when it completes.\n\n#### Merge strategies\n\nBy default, `workmux merge` performs a standard merge commit (configurable via\n`merge_strategy`). You can override the configured behavior with these mutually\nexclusive flags:\n\n- `--rebase`: Rebase the feature branch onto the target before merging (creates\n  a linear history via fast-forward merge). If conflicts occur, you'll need to\n  resolve them manually in the worktree and run `git rebase --continue`.\n- `--squash`: Squash all commits from the feature branch into a single commit on\n  the target. You'll be prompted to provide a commit message in your editor.\n\nIf you don't want to have merge commits in your main branch, use the `rebase`\nmerge strategy, which does `--rebase` by default.\n\n```yaml\n# ~\u002F.config\u002Fworkmux\u002Fconfig.yaml\nmerge_strategy: rebase\n```\n\n#### What happens\n\n1. Determines which branch to merge (specified branch or current branch if\n   omitted)\n2. Determines the target branch (`--into` or main branch from config)\n3. Checks for uncommitted changes (errors if found, unless\n   `--ignore-uncommitted` is used)\n4. Commits staged changes if present (unless `--ignore-uncommitted` is used)\n5. Merges your branch into the target using the selected strategy (default:\n   merge commit)\n6. Deletes the tmux window (including the one you're currently in if you ran\n   this from a worktree) — skipped if `--keep` is used\n7. Removes the worktree — skipped if `--keep` is used\n8. Deletes the local branch — skipped if `--keep` is used\n\n#### Typical workflow\n\nWhen you're done working in a worktree, simply run `workmux merge` from within\nthat worktree's tmux window. The command will automatically detect which branch\nyou're on, merge it into main, and close the current window as part of cleanup.\n\n#### Examples\n\n```bash\n# Merge branch into main (default: merge commit)\nworkmux merge user-auth\n\n# Merge the current worktree you're in\n# (run this from within the worktree's tmux window)\nworkmux merge\n\n# Rebase onto main before merging for a linear history\nworkmux merge user-auth --rebase\n\n# Squash all commits into a single commit\nworkmux merge user-auth --squash\n\n# Merge but keep the worktree\u002Fwindow\u002Fbranch to verify before cleanup\nworkmux merge user-auth --keep\n# ... verify the merge in main ...\nworkmux remove user-auth  # clean up later when ready\n\n# Merge into a different branch (stacked PRs)\nworkmux merge feature\u002Fsubtask --into feature\u002Fparent\n```\n\n---\n\n### `workmux remove [name]...` (alias: `rm`)\n\nRemoves worktrees, tmux windows, and branches without merging (unless you keep\nthe branches). Useful for abandoning work or cleaning up experimental branches.\nSupports removing multiple worktrees in a single command.\n\n- `[name]...`: One or more worktree names (the directory names). Defaults to\n  current directory name if omitted.\n\n#### Options\n\n- `--all`: Remove all worktrees at once (except the main worktree). Prompts for\n  confirmation unless `--force` is used. Safely skips worktrees with uncommitted\n  changes or unmerged commits.\n- `--gone`: Remove worktrees whose upstream remote branch has been deleted\n  (e.g., after a PR is merged on GitHub). Automatically runs `git fetch --prune`\n  first.\n- `--force`, `-f`: Skip confirmation prompt and ignore uncommitted changes\n- `--keep-branch`, `-k`: Remove only the worktree and tmux window while keeping\n  the local branch\n\n#### Examples\n\n```bash\n# Remove the current worktree (run from within the worktree)\nworkmux remove\n\n# Remove a specific worktree with confirmation if unmerged\nworkmux remove experiment\n\n# Remove multiple worktrees at once\nworkmux rm feature-a feature-b feature-c\n\n# Remove multiple worktrees with force (no confirmation)\nworkmux rm -f old-work stale-branch\n\n# Use the alias\nworkmux rm old-work\n\n# Remove worktree\u002Fwindow but keep the branch\nworkmux remove --keep-branch experiment\n\n# Force remove without prompts\nworkmux rm -f experiment\n\n# Remove worktrees whose remote branches were deleted (e.g., after PR merge)\nworkmux rm --gone\n\n# Force remove all gone worktrees (no confirmation)\nworkmux rm --gone -f\n\n# Remove all worktrees at once\nworkmux rm --all\n```\n\n---\n\n### `workmux rename [old-name] \u003Cnew-name>`\n\nRenames a worktree's directory, its tmux window or session, and the per-worktree\nworkmux metadata. Optionally also renames the underlying git branch.\n\n- `[old-name]`: Optional current worktree name. Defaults to the current worktree\n  when run from inside one.\n- `\u003Cnew-name>`: The new handle (directory name and tmux window\u002Fsession base name).\n\n#### Options\n\n- `--branch`, `-b`: Also rename the underlying git branch to match `\u003Cnew-name>`.\n  Fails if the worktree is on a detached HEAD.\n\n#### Examples\n\n```bash\n# Rename a worktree from inside it\nworkmux rename feature-new\n\n# Rename a specific worktree by name\nworkmux rename feature-old feature-new\n\n# Also rename the branch to match\nworkmux rename feature-old feature-new --branch\n```\n\nRename is non-destructive: uncommitted changes and untracked files are\npreserved. The main worktree cannot be renamed. Collisions (existing target\npath, existing tmux target, or existing branch) are rejected before any changes\nare made.\n\n---\n\n### `workmux list` (alias: `ls`)\n\nLists all git worktrees with their agent status, multiplexer window status, and\nmerge status. Supports filtering by worktree handle or branch name.\n\n#### Arguments\n\n- `[worktree-or-branch...]`: Filter by worktree handle (directory name) or\n  branch name. Accepts multiple values. When omitted, shows all worktrees.\n\n#### Options\n\n- `--pr`: Show GitHub PR status for each worktree. Requires the `gh` CLI to be\n  installed and authenticated. Note that it shows pull requests' statuses with\n  [Nerd Font](https:\u002F\u002Fwww.nerdfonts.com\u002F) icons, which requires Nerd Font\n  compatible font installed.\n- `--json`: Output as JSON. Produces a JSON array of objects with fields:\n  `handle`, `branch`, `path`, `is_main`, `mode`, `has_uncommitted_changes`,\n  `is_open`, `created_at`.\n\n#### Examples\n\n```bash\n# List all worktrees\nworkmux list\n\n# List with PR status\nworkmux list --pr\n\n# Output as JSON for scripting\nworkmux list --json\n\n# Filter to specific worktrees\nworkmux list my-feature\nworkmux list feature-auth feature-api\n```\n\n#### Example output\n\n```\nBRANCH      AGE  AGENT  MUX  UNMERGED  PATH\nmain        -    -      -    -         ~\u002Fproject\nuser-auth   2h   🤖     ✓    -         ~\u002Fproject__worktrees\u002Fuser-auth\nbug-fix     3d   ✅     ✓    ●         ~\u002Fproject__worktrees\u002Fbug-fix\napi-work    1w   -      ✓    -         ~\u002Fproject__worktrees\u002Fapi-work\n```\n\n#### Key\n\n- AGE shows how old the worktree is (e.g., `2h`, `3d`, `1w`, `2mo`)\n- AGENT shows the current agent status (see\n  [status tracking](https:\u002F\u002Fworkmux.dev\u002Fguide\u002Fstatus-tracking\u002F)):\n  - `🤖` = working, `💬` = waiting for input, `✅` = finished\n  - Multiple agents per worktree show a count (e.g., `2🤖 1✅`)\n- `✓` in MUX column = multiplexer window exists for this worktree\n- `●` in UNMERGED column = branch has commits not merged into main\n- `-` = not applicable\n\n---\n\n### `workmux config edit`\n\nOpens the global configuration file (`~\u002F.config\u002Fworkmux\u002Fconfig.yaml`) in your\npreferred editor. Uses `$VISUAL`, `$EDITOR`, or falls back to `vi`. Creates the\nfile with commented-out defaults if it doesn't exist yet.\n\n---\n\n### `workmux config path`\n\nPrints the path to the global configuration file. Useful for scripting.\n\n---\n\n### `workmux config reference`\n\nPrints the default configuration file with all options documented. Useful for\ndiscovering available options or piping to an AI agent for context.\n\n---\n\n### `workmux init`\n\nGenerates `.workmux.yaml` with example configuration and `\"\u003Cglobal>\"`\nplaceholder usage.\n\n---\n\n### `workmux open [name...]`\n\nOpens or switches to a tmux window for a pre-existing git worktree. If the\nwindow already exists, switches to it. If not, creates a new window with the\nconfigured pane layout and environment. Accepts multiple names to open several\nworktrees at once.\n\n- `[name...]`: One or more worktree names (the directory name, which is also the\n  tmux window name without the prefix). Optional with `--new` when run from\n  inside a worktree.\n\n#### Options\n\n- `-n, --new`: Force opening in a new window even if one already exists. Creates\n  a duplicate window with a suffix (e.g., `-2`, `-3`). Useful for having\n  multiple terminal views into the same worktree.\n- `-s, --session`: Open in session mode, overriding the stored mode. Persists\n  the mode change for subsequent opens. Cannot be combined with `--new`. Only\n  supported with tmux.\n- `--config \u003Cpath>`: Use an alternate config file for this invocation. Still\n  merges with global config.\n- `--run-hooks`: Re-runs the `post_create` commands (these block window\n  creation).\n- `--force-files`: Re-applies file copy\u002Fsymlink operations. Useful for restoring\n  a deleted `.env` file.\n- `-p, --prompt \u003Ctext>`: Provide an inline prompt for AI agent panes.\n- `-P, --prompt-file \u003Cpath>`: Provide a path to a file containing the prompt.\n- `-c, --continue`: Resume the agent's most recent conversation in this\n  worktree. Injects the appropriate flag for the configured agent (e.g.,\n  `--continue` for Claude, `--resume` for Gemini).\n- `-e, --prompt-editor`: Open your editor to write the prompt interactively.\n- `--prompt-file-only`: Write the prompt file without injecting it into agent\n  commands.\n\n#### What happens\n\n1. Verifies that a worktree with `\u003Cname>` exists.\n2. If a tmux window exists and `--new` is not set, switches to it.\n3. Otherwise, creates a new tmux window (with suffix if duplicating).\n4. (If specified) Runs file operations and `post_create` hooks.\n5. Sets up your configured tmux pane layout.\n6. Automatically switches your tmux client to the new window.\n\n#### Examples\n\n```bash\n# Open or switch to a window for an existing worktree\nworkmux open user-auth\n\n# Force open a second window for the same worktree (creates user-auth-2)\nworkmux open user-auth --new\n\n# Open a new window for the current worktree (run from within the worktree)\nworkmux open --new\n\n# Open in session mode (converts from window mode if needed)\nworkmux open user-auth --session\n\n# Resume the agent's last conversation\nworkmux open user-auth --continue\n\n# Resume and send a follow-up prompt\nworkmux open user-auth --continue -p \"Continue implementing the login flow\"\n\n# Open and re-run dependency installation\nworkmux open user-auth --run-hooks\n\n# Open and restore configuration files\nworkmux open user-auth --force-files\n\n# Open multiple worktrees at once\nworkmux open user-auth api-refactor bugfix-login\n```\n\n---\n\n### `workmux close [name]`\n\nCloses the tmux window for a worktree without removing the worktree or branch.\nThis is useful when you want to temporarily close a window to reduce clutter or\nfree resources, but plan to return to the work later.\n\n- `[name]`: Optional worktree name (the directory name). Defaults to current\n  directory if omitted.\n\n#### Examples\n\n```bash\n# Close the window for a specific worktree\nworkmux close user-auth\n\n# Close the current worktree's window (run from within the worktree)\nworkmux close\n```\n\nTo reopen the window later, use [`workmux open`](#workmux-open-name).\n\n**Tip**: You can also use tmux's native kill-window command (default:\n`prefix + &`) to close a worktree's window with the same effect.\n\n---\n\n### `workmux resurrect`\n\nRestores worktree windows after a tmux or computer crash. Uses persisted agent\nstate files to detect which worktrees had active agents before the crash, then\nreopens them with `--continue` to resume agent conversations.\n\n#### Options\n\n- `--dry-run`: Show what would be restored without doing it.\n\n#### Examples\n\n```bash\n# See what would be restored after a crash\nworkmux resurrect --dry-run\n\n# Restore all worktrees that had agents running\nworkmux resurrect\n```\n\n#### How it works\n\n1. Reads agent state files from `~\u002F.local\u002Fstate\u002Fworkmux\u002Fagents\u002F`\n2. Matches each state file's working directory to a git worktree in the current\n   repo\n3. Skips worktrees that are already open or no longer exist\n4. Opens each matched worktree with `--continue` to resume the agent\n\n---\n\n### `workmux sync-files`\n\nRe-applies file operations (copy and symlink from `files` config) to existing\nworktrees. Useful when you add new entries to the `files` config or a symlink\nwas accidentally deleted.\n\n#### Options\n\n- `--all`: Sync all worktrees instead of just the current one.\n\n#### Examples\n\n```bash\n# Sync files to the current worktree\nworkmux sync-files\n\n# Sync files to all worktrees\nworkmux sync-files --all\n```\n\n---\n\n### `workmux path \u003Cname>`\n\nPrints the filesystem path of an existing worktree. Useful for scripting or\nquickly navigating to a worktree directory.\n\n- `\u003Cname>`: Worktree name (the directory name).\n\n#### Examples\n\n```bash\n# Get the path of a worktree\nworkmux path user-auth\n# Output: \u002FUsers\u002Fyou\u002Fproject__worktrees\u002Fuser-auth\n\n# Use in scripts or with cd\ncd \"$(workmux path user-auth)\"\n\n# Copy a file to a worktree\ncp config.json \"$(workmux path feature-branch)\u002F\"\n```\n\n---\n\n### `workmux dashboard`\n\nOpens a TUI dashboard showing all active AI agents across all tmux sessions.\nUseful for monitoring multiple parallel agents and quickly jumping between them.\n\n#### Options\n\n- `-d, --diff`: Open the diff view directly for the current worktree. Useful\n  when you want to quickly review uncommitted changes without navigating through\n  the agent list.\n- `-P, --preview-size \u003C10-90>`: Set preview pane size as percentage (larger =\n  more preview, less table). Default: 60.\n- `-s, --session`: Filter to only show agents in the current session. Useful for\n  session-per-project workflows where each session maps to a different\n  repository.\n- `-t, --tab \u003Cagents|worktrees>`: Open directly on the specified tab.\n\n\u003C!-- prettier-ignore -->\n> [!IMPORTANT]\n> This feature requires [agent status tracking](#agent-status-tracking) to be\n> configured. Without it, no agents will appear in the dashboard.\n\n![workmux dashboard](https:\u002F\u002Fraw.githubusercontent.com\u002Fraine\u002Fworkmux\u002Frefs\u002Fheads\u002Fmain\u002Fmeta\u002Fdashboard.webp)\n\n#### Keybindings\n\n| Key       | Action                                  |\n| --------- | --------------------------------------- |\n| `1`-`9`   | Quick jump to agent (closes dashboard)  |\n| `Tab`     | Toggle between current and last agent   |\n| `d`       | View diff (opens WIP view)              |\n| `o`       | Open PR in browser                      |\n| `p`       | Peek at agent (dashboard stays open)    |\n| `s`       | Cycle sort mode                         |\n| `\u002F`       | Filter agents by name                   |\n| `F`       | Toggle session filter                   |\n| `f`       | Toggle stale filter (show\u002Fhide stale)   |\n| `i`       | Enter input mode (type to agent)        |\n| `Ctrl+u`  | Scroll preview up                       |\n| `Ctrl+d`  | Scroll preview down                     |\n| `+`\u002F`-`   | Resize preview pane                     |\n| `Enter`   | Go to selected agent (closes dashboard) |\n| `j`\u002F`k`   | Navigate up\u002Fdown                        |\n| `:`       | Open command palette                    |\n| `q`\u002F`Esc` | Quit                                    |\n\n#### Live preview\n\nThe bottom half shows a live preview of the selected agent's terminal output.\nThe preview auto-scrolls to show the latest output, but you can scroll through\nhistory with `Ctrl+u`\u002F`Ctrl+d`. Press `i` to enter input mode and type directly\nto the agent without leaving the dashboard.\n\n#### Columns\n\n- **#**: Quick jump key (1-9)\n- **Project**: Project name (from `__worktrees` path or directory name)\n- **Agent**: Worktree\u002Fwindow name\n- **Git**: Diff stats showing branch changes (dim) and uncommitted changes\n  (bright). Shows a rebase icon when a rebase is in progress.\n- **Status**: Agent status icon (🤖 working, 💬 waiting, ✅ done, or \"stale\")\n- **Time**: Time since last status change\n- **Title**: Claude Code session title (auto-generated summary)\n\n#### Sort modes\n\nPress `s` to cycle through sort modes:\n\n- **Priority** (default): Waiting > Done > Working > Stale\n- **Project**: Group by project name, then by priority within each project\n- **Recency**: Most recently updated first\n- **Natural**: Original tmux order (by pane creation)\n\nYour sort preference persists in the tmux session.\n\n#### Session filter\n\nPress `F` to toggle the session filter. When active, only agents in the current\nsession are shown. This is useful for session-per-project workflows where each\nsession maps to a repository. You can also start the dashboard with `--session`\nto default to session filtering. The preference persists across sessions.\n\n#### Name filter\n\nPress `\u002F` to activate the name filter. Type to filter the agent list by project\nor worktree name (case-insensitive). Press `Enter` to accept the filter and\nreturn to normal navigation, or `Esc` to clear the filter. When a filter is\nactive, it is shown in the footer bar.\n\n#### Stale filter\n\nPress `f` to toggle between showing all agents or hiding stale ones. The filter\nstate persists across dashboard sessions within the same tmux server.\n\n#### Diff view\n\nPress `d` to view the diff for the selected agent. The diff view has two modes:\n\n- **WIP** - Shows uncommitted changes (`git diff HEAD`)\n- **review** - Shows all changes on the branch vs main (`git diff main...HEAD`)\n\nPress `Tab` to toggle between modes. The footer displays which mode is active\nalong with diff statistics showing lines added (+) and removed (-).\n\n| Key       | Action                           |\n| --------- | -------------------------------- |\n| `Tab`     | Toggle WIP \u002F review              |\n| `a`       | Enter patch mode (WIP only)      |\n| `j`\u002F`k`   | Scroll down\u002Fup                   |\n| `Ctrl+d`  | Page down                        |\n| `Ctrl+u`  | Page up                          |\n| `c`       | Send commit command to agent     |\n| `m`       | Trigger merge and exit dashboard |\n| `:`       | Open command palette             |\n| `q`\u002F`Esc` | Close diff view                  |\n\n#### Patch mode\n\nPatch mode (`a` from WIP diff) allows staging individual hunks like\n`git add -p`. This is useful for selectively staging parts of an agent's work.\n\nWhen [delta](https:\u002F\u002Fgithub.com\u002Fdandavison\u002Fdelta) is installed, hunks are\nrendered with syntax highlighting for better readability.\n\n| Key       | Action                           |\n| --------- | -------------------------------- |\n| `y`       | Stage current hunk               |\n| `n`       | Skip current hunk                |\n| `u`       | Undo last staged hunk            |\n| `s`       | Split hunk (if splittable)       |\n| `o`       | Comment on hunk (sends to agent) |\n| `j`\u002F`k`   | Navigate to next\u002Fprevious hunk   |\n| `:`       | Open command palette             |\n| `q`\u002F`Esc` | Exit patch mode                  |\n\nPress `y` to stage the current hunk and advance to the next. Press `n` to skip\nwithout staging. The counter in the header shows your progress (e.g., `[3\u002F10]`).\n\nPress `s` to split the current hunk into smaller pieces when there are context\nlines between separate changes. Press `u` to undo the last staged hunk.\n\nPress `o` to comment on the current hunk. This sends a message to the agent\nincluding the file path, line number, the diff hunk as context, and your\ncomment. Useful for giving feedback like \"This function should handle the error\ncase\".\n\n#### Example tmux binding\n\nAdd to your `~\u002F.tmux.conf` for quick access:\n\n```bash\nbind C-s display-popup -h 30 -w 100 -E \"workmux dashboard\"\n\n# Open directly on Worktrees tab\nbind C-w display-popup -h 30 -w 100 -E \"workmux dashboard --tab worktrees\"\n```\n\nThen press `prefix + Ctrl-s` to open the dashboard as a tmux popup.\n\n---\n\n### `workmux sidebar`\n\nToggles a live agent status sidebar on the left side of all tmux windows. Shows\nall active agents across all sessions and projects with live status updates,\nproviding an always-visible overview without taking over the full screen like\nthe dashboard.\n\n```bash\nworkmux sidebar            # Toggle sidebar on\u002Foff (all sessions)\nworkmux sidebar --session  # Toggle current session only, or opt out of global mode\n```\n\nThe sidebar displays:\n\n- Status icon (working\u002Fwaiting\u002Fdone with spinner animation)\n- Project and worktree name (e.g. `myproject\u002Ffix-bug`)\n- Elapsed time since last status change\n\n| Key     | Action             |\n| ------- | ------------------ |\n| `j`\u002F`k` | Navigate up\u002Fdown   |\n| `Enter` | Jump to agent      |\n| `g`\u002F`G` | Jump to first\u002Flast |\n| `v`     | Toggle layout mode |\n| `q`     | Quit sidebar       |\n\nWhen the global sidebar is active, `workmux sidebar --session` hides it in the\ncurrent tmux session only. Run the same command again to show it in that session\nagain while keeping the global sidebar active elsewhere.\n\nConfigure width and layout in `.workmux.yaml`:\n\n```yaml\nsidebar:\n  width: 40 # absolute columns, or \"15%\" for percentage\n  layout: tiles # \"compact\" or \"tiles\" (default)\n```\n\n#### Example tmux binding\n\n```bash\nbind C-t run-shell \"workmux sidebar\"\n```\n\nThen press `prefix + Ctrl-t` to toggle the sidebar.\n\n> **Note:** The sidebar is currently tmux-only. When enabled, a sidebar pane is\n> created in every existing window, and new windows automatically get one via a\n> tmux hook.\n\n---\n\n### `workmux sandbox`\n\nCommands for managing sandbox functionality. See the\n[sandbox guide](https:\u002F\u002Fworkmux.raine.dev\u002Fguide\u002Fsandbox\u002F) for full\ndocumentation.\n\n| Command               | Description                                            |\n| --------------------- | ------------------------------------------------------ |\n| `sandbox pull`        | Pull the latest container image from the registry      |\n| `sandbox build`       | Build the container image locally                      |\n| `sandbox shell`       | Start an interactive shell inside a sandbox            |\n| `sandbox agent`       | Run the configured agent in a sandbox with RPC support |\n| `sandbox stop`        | Stop running Lima VMs                                  |\n| `sandbox prune`       | Delete unused Lima VMs to reclaim disk space           |\n| `sandbox install-dev` | Cross-compile and install workmux into sandboxes (dev) |\n\n---\n\n### `workmux claude prune`\n\nRemoves stale entries from Claude config (`~\u002F.claude.json`) that point to\ndeleted worktree directories. When you run Claude Code in worktrees, it stores\nper-worktree settings in that file. Over time, as worktrees are merged or\ndeleted, it can accumulate entries for paths that no longer exist.\n\n#### What happens\n\n1. Scans `~\u002F.claude.json` for entries pointing to non-existent directories\n2. Creates a backup at `~\u002F.claude.json.bak` before making changes\n3. Removes all stale entries\n4. Reports the number of entries cleaned up\n\n#### Safety\n\n- Only removes entries for absolute paths that don't exist\n- Creates a backup before modifying the file\n- Preserves all valid entries and relative paths\n\n#### Examples\n\n```bash\n# Clean up stale Claude Code entries\nworkmux claude prune\n```\n\n#### Example output\n\n```\n  - Removing: \u002FUsers\u002Fuser\u002Fproject__worktrees\u002Fold-feature\n\n✓ Created backup at ~\u002F.claude.json.bak\n✓ Removed 3 stale entries from ~\u002F.claude.json\n```\n\n---\n\n### `workmux completions \u003Cshell>`\n\nGenerates shell completion script for the specified shell. Completions provide\ntab-completion for commands and dynamic branch name suggestions.\n\n- `\u003Cshell>`: Shell type: `bash`, `zsh`, or `fish`.\n\n#### Examples\n\n```bash\n# Generate completions for zsh\nworkmux completions zsh\n```\n\nSee the [Shell Completions](#shell-completions) section for installation\ninstructions.\n\n---\n\n### `workmux docs`\n\nDisplays this README with terminal formatting. Useful for quick reference\nwithout leaving the terminal.\n\nWhen run interactively, renders markdown with colors and uses a pager (`less`).\nWhen piped (e.g., to an LLM), outputs raw markdown for clean context.\n\n#### Using with AI agents\n\nYou can ask an agent to read the docs and configure workmux for you:\n\n```\n> run `workmux docs` and configure workmux so that on the left pane\n  there is claude as agent, and on the right side neovim and empty\n  shell on top of each other\n\n⏺ Bash(workmux docs)\n  ⎿  \u003Cp align=\"center\">\n       \u003Cpicture>\n     … +923 lines\n\n⏺ Write(.workmux.yaml)\n  ⎿  Wrote 9 lines to .workmux.yaml\n\n⏺ Created .workmux.yaml with the layout:","workmux 是一个结合了 git worktrees 和 tmux 窗口的开发工具，旨在实现零摩擦的并行开发。它利用 Rust 语言编写，支持通过简单的命令创建和管理多个独立的开发环境，每个环境都有自己的终端状态、编辑器会话、开发服务器和 AI 代理。特别适合需要同时处理多个功能或运行多个 AI 代理而不会产生冲突的场景。此外，workmux 能够自动设置新的工作树，并在合并分支时一键清理相关资源，包括删除工作树、关闭 tmux 窗口以及移除本地分支。该工具鼓励基于现有的终端工具（如 tmux、zellij 或 kitty）构建工作流，从而减少对可能短命的图形界面工具的依赖。",2,"2026-06-11 03:53:15","trending"]