Skip to content

Configuration

Config file locations

Config merges two tiers (local wins):

PriorityPathScope
1 (highest)~/.willow/repos/<repo>.git/willow.jsonPer-repo, local only
2~/.config/willow/config.jsonGlobal defaults

The local config lives inside the bare repo directory, so it's private to your machine. Global config provides machine-wide defaults for all repos.

Config schema

jsonc
{
  "baseBranch": "main",
  "branchPrefix": "alice",
  "postCheckoutHook": ".husky/post-checkout",
  "setup": ["npm install", "cp .env.example .env"],
  "teardown": [],
  "defaults": {
    "fetch": true,
    "autoSetupRemote": true
  }
}

Fields

FieldTypeDescription
baseBranchstringDefault branch to fork new worktrees from
branchPrefixstringPrefix for new branch names (e.g. alicealice/feature-auth)
postCheckoutHookstringScript to run after creating a worktree
setupstring[]Commands to run after creating a worktree (e.g. install deps)
teardownstring[]Commands to run before removing a worktree
defaults.fetchbooleanWhether to fetch before creating a worktree
defaults.autoSetupRemotebooleanAuto-configure remote tracking for new branches

Directory structure

~/.willow/
├── repos/                       # Bare clones
│   └── myrepo.git/
│       └── willow.json          # Per-repo config
├── worktrees/                   # All worktrees, grouped by repo
│   └── myrepo/
│       ├── main/
│       ├── auth-refactor/
│       └── payments/
├── status/                      # Claude Code agent status
│   └── myrepo/
│       ├── main.json
│       └── auth-refactor.json
└── hooks/                       # Hook scripts
    └── claude-status-hook.sh

~/.willow/repos/

Contains bare git clones. Each repo is cloned once with ww clone and shared across all worktrees. Per-repo config (willow.json) lives here.

~/.willow/worktrees/

Each worktree is a fully isolated directory with its own working copy. Grouped by repo name — ~/.willow/worktrees/<repo>/<branch>/.

~/.willow/status/

Created by ww cc-setup. Contains JSON files with Claude Code agent status for each worktree.

jsonc
// ~/.willow/status/myrepo/auth-refactor.json
{
  "status": "BUSY",
  "timestamp": "2024-01-15T10:30:00Z",
  "worktree": "auth-refactor"
}

~/.willow/hooks/

Contains hook scripts installed by ww cc-setup. The claude-status-hook.sh fires on Claude Code PostToolUse and Stop events.