One task, one worktree, one branch. Start with add, find things with ls and which, reset build output with clear, finish with rm or let sweep remove what merged. Output below is real.
cowtree add <base> <topic>
Clones the base into <wt_root>/<repo>-<topic> on branch <topic> and prints the path. --from, --branch, --exclude, --also.
$ cowtree add ~/code/myapp payments-retry
Preparing worktree (new branch 'payments-retry')
~/code/wt/myapp-payments-retry
cowtree which <branch>, branches
Which worktree holds a branch. The link lives in git config, so it survives without cowtree.
$ cowtree branches ~/code/myapp
main (base)
payments-retry ~/code/wt/myapp-payments-retry
search-index ~/code/wt/myapp-search-index
$ cowtree which search-index ~/code/myapp
~/code/wt/myapp-search-index
cowtree ls [<base>] | --all
Every worktree of a base, or every cowtree worktree, with branch, logical size and the bytes it actually owns.
$ cowtree ls ~/code/myapp
~/code/myapp (base)
~/code/wt/myapp-payments-retry [payments-retry] logical 301.0MB owned 12.0KB
$ cowtree status wt/myapp-payments-retry
branch payments-retry (base on main)
changes 1 uncommitted
owned 12.0KB
cowtree clear <worktree>
Git tracks the source; everything ignored is build output. clear throws the worktree's ignored paths away and re-clones them from the base, so they match the base again and the blocks they owned are freed. Tracked files and their edits are never touched; untracked files that are not ignored are kept unless you pass --untracked. Alias: reset.
$ cowtree clear wt/myapp-checkout-v2 --dry-run
would reclone .next
would reclone node_modules
keep NOTES.md (untracked, not ignored; --untracked to reset it)
owned 42.6MB, would free about 42.6MB
$ cowtree clear wt/myapp-checkout-v2
reclone .next
reclone node_modules
keep NOTES.md (untracked, not ignored; --untracked to reset it)
owned 42.6MB -> 16.0KB
$ git -C wt/myapp-checkout-v2 status --short
M app/page.tsx
?? NOTES.md
cowtree rm <worktree>, sweep
rm removes a worktree and deletes its branch if merged. sweep removes every clean worktree whose branch or GitHub PR merged, squash and rebase included.
$ cowtree sweep ~/code/myapp --dry-run
would remove ~/code/wt/myapp-fix-login [fix-login merged into main]
skip ~/code/wt/myapp-payments-retry (not clean)
$ cowtree rm wt/myapp-fix-login
deleted merged branch fix-login