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.1.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.1.tar.gz.
File metadata
- Download URL: wtcode-0.1.1.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 |
d3d4cd35576f9b6ce28f2f613d8d45b398d484e18c65b3457130d0c989ca1f66
|
|
| MD5 |
f5ce70d23180c51cd491d7a31bb217cc
|
|
| BLAKE2b-256 |
f11b21cc33cf688e7c317e713a939def8365d6baba03d769eb74a26e498dc9b9
|
File details
Details for the file wtcode-0.1.1-py3-none-any.whl.
File metadata
- Download URL: wtcode-0.1.1-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 |
e1be2a08c0247cf7c05b97c204f50633118b4c03341e7383760760b476fcf081
|
|
| MD5 |
2c7a445d2eaeace54a1626957c02a926
|
|
| BLAKE2b-256 |
408a714c62a9f88b6d3a8c5b769a3694ba8d9207b56667199a6f05213cd60306
|