Blog
-
I timed every command in my CLI on a 95-worktree project
Four commands took over ten seconds. The fix was not making the work faster, it was taking the work off the read path. Includes the two instruments that lied to me and the command that is still slow today.
-
Your agent created the worktree. Now it does not run.
Coding agents create worktrees themselves, and a fresh checkout has no .env, no dependencies and no port of its own. The hook that fixes it makes you take over worktree creation, which is the part worth reading before you wire anything.
-
What is using port 5000 on your Mac (and why your tools call it a running server)
AirPlay Receiver holds 5000 and 7000, answers HTTP 403 as AirTunes, and satisfies every readiness probe pointed at it. Whether it collides with your server depends on one socket option. Four false positives I found in my own tool, and the classifier that fixes all of them.
-
Using pwt ports as a central registry for every app on your machine
Scanning finds a port that is free right now, which is why two projects end up with the same number: a sleeping app still owns one. Allocation is bookkeeping, naming is a proxy, and they are different problems.
-
How to make every coding agent create worktrees your way
Instructions are advisory, a deny rule is mechanical, and adopting after the fact needs no cooperation at all. Three layers, verified syntax, and the honest note on when none of it is worth wiring.
-
How to run a command in every git worktree
Git has submodule foreach but no worktree foreach, so everyone writes the loop by hand. I tested the four versions the internet suggests: two hide failures, one aborts halfway, one breaks on a space.
-
Cleaning up merged git worktrees without losing work
git worktree remove refuses dirty worktrees, --force destroys them, and git branch --merged cannot see a squash merge. I measured all three on one scratch repo, then wired the safe version.
-
The node_modules store I deleted is now a pnpm feature
pnpm's enableGlobalVirtualStore is the shared symlink store I built and abandoned. I re-measured with git worktrees: installs drop to 0.3s, node_modules drops to 140K, and one hand-edited file contaminates every worktree on the machine.
-
I found two global gitignores on my machine. Both were the wrong layer.
Agent configs, derived lockfiles, generated files: every worktree needs them, no commit should contain them. The usual answer is a global gitignore, and mine was hiding 36 files across 10 repos, one of which tracks the files it hid.
-
How to gitignore per worktree
The .git/worktrees/
/info/exclude file every answer cites is never read by git. Here is the measurement, the method that actually works, and the two gotchas inside it. -
How to add an existing repo to pwt
One command inside the repo, three lines of state outside it, nothing written into your project. What pwt init actually does, how to navigate with a two-letter alias, and how to undo all of it.
-
Your OAuth callback accepts one URL. You have six worktrees.
Per-branch URLs are great for browsing and useless for a provider that knows one address. The fix is the opposite shape: one stable URL you repoint.
-
How to deal with port allocation in git worktrees
Every dev server in every worktree wants port 3000. Half your stack dies with EADDRINUSE, the other half silently moves to 3001, and the tab you are debugging is now served by the wrong branch.
-
Your agent finished. How would you know?
I shipped a blocking wait for background jobs so agents stop polling. Then I counted: my own agents used it 5 times in 23,770 commands and hand-rolled the wait loop instead.
-
How to copy .env into a git worktree, and what it breaks
Copying untracked config into a new worktree is the standard answer. Three worktrees later, two servers will not start and one branch is corrupting another's database.
-
62 processes to print a version number
pwt spawned 62 jq processes before printing its version. Removing them took two rewrites, and only one of them was about speed.
-
I deleted 2,471 lines after reading my own logs
A TUI nobody ran, found by mining shell history and agent session logs. Humans navigate, agents execute, and neither one asks the CLI for a picture.
-
63 Git worktrees, one node_modules problem
63 worktrees, 7 real dependency sets: pnpm's copy-on-write clones replaced 29GB of copied node_modules. Gotchas included.
-
A leaked file descriptor hung our CI for six hours (five times in a row)
A coverage job sat silent until GitHub's 6-hour timeout. The cause: one file descriptor leaked into a daemon.