Group of 3 Under the hood
Parsing of git worktree list --porcelain output is now checked for duplicate paths and can use NUL-separated output for safety
What
Parsing of git worktree list --porcelain output was made more robust in two ways:
- A new validation check looks for duplicate worktree paths in the parsed listing, normalizing paths to NFC on macOS first, and is run as a standalone check before the usual branch-matching scan; if it finds duplicates or an inconsistent listing, the scan is skipped and treated as unreliable.
- Worktree listing now probes whether the installed git supports NUL-separated output and, when it does, passes
-ztogit worktree list --porcelainand splits entries on the null character instead of newlines, avoiding ambiguity when a worktree path itself contains a newline.
Why
Both changes prevent Claude Code from misreading the worktree list when paths are duplicated, unicode-normalized differently, or contain unusual characters like newlines, which could otherwise cause it to match the wrong worktree.