wt

wt setup

Run the setup pipeline on an existing worktree.

Synopsis

wt setup [path] [options]

Description

wt setup runs the setup pipeline on an existing worktree. This is the command invoked automatically by the git hook and Claude Code hook.

You can also call it manually to re-run setup after changing .worktreerc, or to set up a worktree that was created without wt add.

Arguments

ArgumentDescription
[path]Path to the worktree to set up (default: current directory)

Options

OptionDescription
--forceRe-run even if setup was already completed
--cleanRemove node_modules / .venv before reinstalling
--no-depsSkip dependency installation
--no-envSkip .env file setup
--no-hooksSkip hook commands

Examples

# Set up the current directory
wt setup
 
# Set up a specific worktree by path
wt setup ../myapp-feat-billing
 
# Re-run after changing .worktreerc
wt setup --force
 
# Clean reinstall (removes node_modules and .venv first)
wt setup --clean --force

Exit Codes

CodeMeaning
0Success
1Fatal error
2Completed with warnings

Setup Status

wt setup writes a .wt-status.json file to the worktree root after completion. This file records the setup timestamp, ecosystem, and outcome. wt list reads these files to show status in the table output.

If you delete .wt-status.json, the worktree will show as pending in wt list, and wt setup will re-run from scratch (as if --force was passed).

On this page