workz
Zoxide for Git worktrees — zero-config dependency syncing, fuzzy switching, and AI-agent support.
Git worktrees let you work on multiple branches simultaneously, but they leave behind your .env files and force you to re-install node_modules every time. workz fixes this automatically.
The Problem
# Where's my .env? Gone.
# Where's node_modules? Gone. Time to wait for npm install again.
# Another 2GB of disk space wasted on duplicate dependencies.
The Fix
# .env files copied, node_modules symlinked, you're in the worktree. Done.
Features
- Auto-symlink heavy directories —
node_modules,target,.venv,vendorare symlinked, not duplicated - Auto-copy env files —
.env,.env.local,.envrccarried over automatically - Fuzzy switching — zoxide-style instant navigation between worktrees
- AI-agent ready — launch Claude Code, Cursor, or VS Code in a worktree with
--ai - Shell integration —
cdinto worktrees automatically, just like zoxide - Zero config — works out of the box for Node, Rust, Python, and Go projects
- Custom rules — optional
.workz.tomlfor project-specific sync patterns - Safe defaults — never overwrites existing files, never force-deletes dirty worktrees
Install
Or build from source:
Shell Setup
Add to your ~/.zshrc (or ~/.bashrc):
For fish, add to ~/.config/fish/config.fish:
workz init fish | source
This gives you a workz shell function that auto-cds into worktrees.
Usage
Create a worktree
What happens:
- Creates
../myrepo--feature-loginas a git worktree - Symlinks
node_modules,target,.venv(if they exist in the main repo) - Copies
.env*files into the new worktree cds you into the worktree (with shell integration)
List worktrees
main /home/you/myrepo
feature-login /home/you/myrepo--feature-login [modified]
bugfix-crash /home/you/myrepo--bugfix-crash
Switch between worktrees
Remove a worktree
Clean up stale entries
Configuration
Create a .workz.toml in your project root to customize sync behavior:
[]
# Directories to symlink (shared, saves disk space)
= ["node_modules", "target", ".venv", "vendor", "my-large-cache"]
# File patterns to copy into new worktrees
= [".env*", ".envrc", ".tool-versions", "secrets.json"]
# Patterns to never sync
= ["logs", "tmp"]
[]
# Run after creating a worktree
= "pnpm install --frozen-lockfile"
# Run before removing a worktree
= "docker compose down"
Without a config file, workz uses sensible defaults that work for most Node, Rust, Python, and Go projects.
Default sync rules
Symlinked directories (if they exist): node_modules, target, .venv, venv, .direnv, vendor
Copied files (if they exist): .env*, .envrc, .tool-versions
AI Agent Workflow
Running multiple AI agents in parallel? Each one needs its own worktree:
How It Compares
| Feature | workz | worktrunk | gwq | fracture | branchlet |
|---|---|---|---|---|---|
| Auto-symlink deps | yes | config required | no | no | no |
| Auto-copy .env | yes | config required | config required | yes | no |
| Fuzzy switching | yes | no | yes | no | no |
| Shell cd integration | yes | no | no | no | no |
| AI agent launch | yes | yes | no | no | no |
| Zero config | yes | no | no | yes | no |
| Single binary | yes | yes | yes | ? | no (npm) |
| Custom config | yes | yes | yes | no | yes |
Requirements
- Git 2.15+ (for worktree support)
- A Unix-like system (Linux, macOS) or Windows with Developer Mode
License
MIT OR Apache-2.0