{"version":"2.1.271","anchor":"worktree-list-validation-gains-caseunicode-normalization-du","canonical_anchor":"worktree-list-validation-gains-caseunicode-normalization-du","heading":"git worktree list parsing gets duplicate-path and NUL-separated output handling","tier":"internal","area":"Worktrees","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271\/e\/worktree-list-validation-gains-caseunicode-normalization-du","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271","markdown":"### git worktree list parsing gets duplicate-path and NUL-separated output handling\n\nParsing of git worktree list --porcelain output is now checked for duplicate paths and can use NUL-separated output for safety\n\n**What**\n\nParsing of `git worktree list --porcelain` output was made more robust in two ways:\n\n- 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.\n\n- Worktree listing now probes whether the installed git supports NUL-separated output and, when it does, passes `-z` to `git worktree list --porcelain` and splits entries on the null character instead of newlines, avoiding ambiguity when a worktree path itself contains a newline.\n\n**Why**\n\nBoth 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.\n\n- Area: Worktrees\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 1\/5"}