An interactive Git worktree manager powered by fzf. Create, switch, and clean up worktrees without remembering any git worktree commands.
Note: This tool is optimized for and tested on macOS only.
cargo install fzf-worktree
worktree aliasAdd the printed alias to your shell config (~/.bashrc, ~/.zshrc, etc.):
wt() {
case "$1" in
list|remove|rm|prefix|alias|help|-h|--help)
worktree "$@"
;;
*)
case "$2" in
-h|--help) worktree "$@" ;;
*)
local dir
dir="$(worktree "$@")" || return
[ -z "$dir" ] || cd "$dir"
;;
esac
;;
esac
}git clone https://github.com/brucemacd/wt.git
cd wt
cargo build --release
cp target/release/worktree ~/.local/bin/| Command | Description |
|---|---|
wt |
Open interactive picker — select an existing worktree or type a new branch name |
wt add <name> |
Create or switch to a worktree by name without opening the picker |
wt new <name> |
Create or switch to a worktree by name |
wt exit |
Return to the main repo directory (alias: wt x) |
wt list |
List branches and paths for the current project's worktrees |
wt remove <name> |
Delete a worktree (alias: wt rm) |
wt prefix "feature/" |
Set a prefix applied to all new branch names |
wt prefix |
Show the current prefix |
wt prefix "" |
Clear the prefix |
- Run
wtinside any Git repo - An fzf picker shows your existing worktrees, including detached worktrees created by Codex
- When available, Codex worktrees include the associated chat title from Codex's local metadata
- If that metadata can't be read, they fall back to a stable
codex/<id>label
- Select one to switch, or type a new branch name and press Enter
- New worktrees are created at
~/.wt/<repo>/<branch>/
# Start a feature
wt # type "feature-xyz", press Enter
# ... write code ...
git push -u origin feature-xyz
gh pr create
# Switch context
wt # pick another worktree
# Cleanup after merge
wt exit
wt remove feature-xyz# Build and install locally
cargo install --path .
# Build without installing (binary at target/debug/worktree)
cargo build
# Run directly without installing
cargo run -- [command]After rebuilding, run cargo install --path . to update the installed binary.