gwtl: git worktree list, plus the metadata you actually need

1 min read

Worktrees are now built into Claude Code. It used to be DIY — if you wanted isolation between tasks, you set it up yourself. Now it's the default, to the point that it's genuinely hard to turn off. I didn't like that at first and tried to disable it. Eventually I got used to it and don't mind it anymore.

The tools it uses are CreateWorktree, EnterWorktree, and ExitWorktree. Under the hood it's basically checking out a branch, except the checkout lives in .claude/worktrees/ instead of alongside your other branches.

Two annoyances so far. /export doesn't drop its output at the repo root, which is where I'd want it. And it's worth making sure your default branch is actually named main — Claude Code assumes that's the base for new worktrees, so if your real default is main2 or dev, it'll happily branch off the wrong one, and you won't notice until you've got five PRs open that all need rebasing. Name your default branch main and the problem goes away.

One quality-of-life improvement over plain git worktree list: I had CC make gwtl, a small zsh function that wraps git worktree list --porcelain and adds two columns — when the worktree was created, and when a file inside it was last touched (skipping .git, node_modules, and build output).

Grab it from the gist below and paste it into your ~/.zshrc. macOS/zsh-only.

gwtl.zsh →