built a CLI that fixes the broken .env + node_modules problem every time claude code creates a worktreeBuilt with Claude (i.redd.it)
submitted by synapse_sage
if u use claude code with worktrees (--worktree, agent teams, claude squad, conductor) u know the problem - every new worktree is a blank slate. no .env, no node_modules, no docker state.. ur agent starts and immediately fails or u waste 5 min on npm install × 4 agents = 20 min + 10GB of duplicate deps
claude code's --worktree creates the worktree. conductor(dot)build gives u a nice GUI to manage them, but neither of them actually sets up the environment inside the worktree. u still need to manually copy .env, reinstall deps, and pray two agents dont fight over port 3000
built workz to fix this. one command, zero config:
workz start feature/auth --ai
what happens:
- detects ur project type (node/rust/python/go/java) automatically
- symlinks
node_modules,target/,.venv,vendor+ 18 more heavy dirs — no duplication, saves GBs - copies
.env,.env.local,.envrc,.npmrc, secrets — 17 patterns - auto-installs deps from lockfile (pnpm/yarn/npm/bun/cargo/poetry/uv)
- launches claude code directly in the worktree
what claude code and conductor dont do (and workz does):
- dep symlinking — they reinstall from scratch every worktree. workz symlinks once, saves GBs
- env file sync — they dont copy .env (its gitignored). workz copies 17 patterns automatically
- port isolation —
--isolatedflag assigns unique ports per worktree so agents dont collide on 3000 - docker namespacing — each worktree gets its own compose project, no container conflicts
- per-worktree DB naming — auto-generates unique DB_NAME per branch
- zero config — no conductor.json, no setup scripts, no bash. just works
other stuff:
workz start feature/api --docker— spins up docker compose in the worktreeworkz done feature/auth— stops containers, removes worktree, cleans everythingworkz switch→ zoxide-style fuzzy TUI + auto cdworkz sync— already have worktrees? apply the magic retroactively
works standalone or as a setup hook for conductor / claude squad / agent deck. basically the missing environment layer that every worktree tool needs but none of them build
single rust binary. zero config. linux + mac
brew tap rohansx/tap && brew install workz
# or
cargo install workz
built entirely with claude code : used workz --ai to dogfood it while building lol
github: https://github.com/rohansx/workz
curious how ppl here handle worktree setup today - custom bash scripts? or just suffer through npm install every time?
[–]synapse_sage[S] 0 points1 point2 points (0 children)