Launch your favorite code tool in a git worktree
Project description
wtcode
Launch your favorite code tool in a git worktree.
worktree code / what-the-code -- streamlines git worktree selection, creation, and launching tools like Claude Code, lazygit, your editor, or any command.
Install
Homebrew
brew install netj/tap/wtcode
PyPI (via uv)
uvx wtcode
Or install globally:
uv tool install wtcode
From source
git clone https://github.com/netj/wtcode.git
ln -s "$PWD/wtcode/wtcode.sh" /usr/local/bin/wtcode
Usage
wtcode [BRANCH] [CMD [CMD-ARGS...]]
BRANCH-- Git branch or worktree name. If omitted and fzf is available, interactively select one. Prefix with:to create a new branch (use:::nameto avoid fzf matching the colons).CMD-- Command to launch in the worktree. Defaults to$WTCODE_CMD, or the first available of:claude,aider,codex,$SHELL.
Examples
wtcode feature-x # launch default tool in feature-x worktree
wtcode feature-x lazygit # launch lazygit
wtcode feature-x claude --resume # launch claude with flags
wtcode :new-feature # create new branch and worktree
wtcode # interactive branch selection via fzf
WTCODE_CMD=cursor wtcode feature # use cursor as default tool
Environment variables
| Variable | Description |
|---|---|
WTCODE_CMD |
Default tool to launch (e.g., claude, lazygit, vim, cursor) |
WTCODE_DEBUG |
Enable debug tracing when set to any value |
GIT_WORKTREE_ROOT |
Override the directory where worktrees are created |
How it works
- Select/specify a branch -- pass as argument or pick interactively with fzf
- Create or switch to the worktree -- worktrees are organized under
$GIT_WORKTREE_ROOT(defaults to../<repo>.worktrees/) - Launch a tool -- runs the specified command (or smart default) inside the worktree
Dependencies
- git -- required
- fzf -- recommended, for interactive branch selection
- jq -- optional, for Claude Code auto-trust setup
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wtcode-0.1.0.tar.gz
(6.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wtcode-0.1.0.tar.gz.
File metadata
- Download URL: wtcode-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2236f6b49908892580c3c2499c59299b549bb43a0b0111a6821c622221323e6
|
|
| MD5 |
3dd36f4d2233212f6ee8846edeafbb43
|
|
| BLAKE2b-256 |
998ef87b79b40fbbd3e4b067981f100856d9ecda6e47009fd1ba23eff5a3bcdc
|
File details
Details for the file wtcode-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wtcode-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c6fe583096ad33e099afacd5700cd31d06fa6b5968bbafd6966115f1bb6e888
|
|
| MD5 |
887d4ae91ab4ca9d27ea0cd2622d4630
|
|
| BLAKE2b-256 |
3e2f7cadf2ed9dababd29330c2d53d62ed60129761f1e3c3f53b1b4b7084be8b
|