Skip to content

Configuration

workmux uses a two-level configuration system:

  • Global (~/.config/workmux/config.yaml): Personal defaults for all projects
  • Project (.workmux.yaml): Project-specific overrides

Project settings override global settings. For post_create and file operation lists (files.copy, files.symlink), you can use "<global>" to include global values alongside project-specific ones. Other settings like panes are replaced entirely when defined in the project config.

Global configuration example

~/.config/workmux/config.yaml:

yaml
window_prefix: "\uf418 " # Use nerdtree branch icon as prefix
merge_strategy: rebase # Make workmux merge do rebase by default
agent: claude

panes:
  - command: <agent> # Start the configured agent (e.g., claude)
    focus: true
  - split: horizontal # Second pane with default shell

Project configuration example

.workmux.yaml:

yaml
post_create:
  - "<global>"
  - mise use

files:
  symlink:
    - "<global>" # Include global symlinks (node_modules)
    - .pnpm-store # Add project-specific symlink

panes:
  - command: pnpm install
    focus: true
  - command: <agent>
    split: horizontal
  - command: pnpm run dev
    split: vertical

For a real-world example, see workmux's own .workmux.yaml.

Configuration options

Most options have sensible defaults. You only need to configure what you want to customize.

Basic options

OptionDescriptionDefault
main_branchBranch to merge intoAuto-detected
worktree_dirDirectory for worktrees (absolute or relative)<project>__worktrees/
window_prefixPrefix for tmux window nameswm-
agentDefault agent for <agent> placeholderclaude
merge_strategyDefault merge strategy (merge, rebase, squash)merge

Naming options

OptionDescriptionDefault
worktree_namingHow to derive names from branchesfull
worktree_prefixPrefix for worktree directories and windowsnone

worktree_naming strategies:

  • full: Use the full branch name (slashes become dashes)
  • basename: Use only the part after the last / (e.g., prj-123/featurefeature)

Panes

Define your tmux pane layout with the panes array:

yaml
panes:
  - command: <agent>
    focus: true
  - command: npm run dev
    split: horizontal
    size: 15

Each pane supports:

OptionDescriptionDefault
commandCommand to run (use <agent> for configured agent)Shell
focusWhether this pane receives focusfalse
splitSplit direction (horizontal or vertical)
sizeAbsolute size in lines/cells50%
percentageSize as percentage (1-100)50%

TIP

The <agent> placeholder must be the entire command value to be substituted. To add extra flags, either include them in the agent config (e.g., agent: "claude --verbose") or use the literal command name (e.g., command: "claude --verbose").

File operations

Copy or symlink files into new worktrees:

yaml
files:
  copy:
    - .env
  symlink:
    - node_modules
    - .pnpm-store

Both copy and symlink accept glob patterns.

Lifecycle hooks

Run commands at specific points in the worktree lifecycle. All hooks run with the worktree directory as the working directory and receive environment variables: WM_HANDLE, WM_WORKTREE_PATH, WM_PROJECT_ROOT.

HookWhen it runsAdditional env vars
post_createAfter worktree creation, before tmux window opens
pre_mergeBefore merging (aborts on failure)WM_BRANCH_NAME, WM_TARGET_BRANCH
pre_removeBefore worktree removal (aborts on failure)

Example:

yaml
post_create:
  - direnv allow

pre_merge:
  - just check

Agent status icons

Customize the icons shown in tmux window names:

yaml
status_icons:
  working: "🤖" # Agent is processing
  waiting: "💬" # Agent needs input (auto-clears on focus)
  done: "✅" # Agent finished (auto-clears on focus)

Set status_format: false to disable automatic tmux format modification.

Default behavior

  • Worktrees are created in <project>__worktrees as a sibling directory to your project by default
  • If no panes configuration is defined, workmux provides opinionated defaults:
    • For projects with a CLAUDE.md file: Opens the configured agent (see agent option) in the first pane, defaulting to claude if none is set.
    • For all other projects: Opens your default shell.
    • Both configurations include a second pane split horizontally
  • post_create commands are optional and only run if you configure them

Automatic setup with panes

Use the panes configuration to automate environment setup. Unlike post_create hooks which must finish before the tmux window opens, pane commands execute immediately within the new window.

This can be used for:

  • Installing dependencies: Run npm install or cargo build in a focused pane to monitor progress.
  • Starting services: Launch dev servers, database containers, or file watchers automatically.
  • Running agents: Initialize AI agents with specific context.

Since these run in standard tmux panes, you can interact with them (check logs, restart servers) just like a normal terminal session.

TIP

Running dependency installation (like pnpm install) in a pane command rather than post_create has a key advantage: you get immediate access to the tmux window while installation runs in the background. With post_create, you'd have to wait for the install to complete before the window even opens. This also means AI agents can start working immediately in their pane while dependencies install in parallel.

yaml
panes:
  # Pane 1: Install dependencies, then start dev server
  - command: pnpm install && pnpm run dev

  # Pane 2: AI agent
  - command: <agent>
    split: horizontal
    focus: true

Released under the MIT License.