Follow Discord
Sweep 22 Sep 2026 · 17:19Z Build v2.1.280 501 read Stable v2.1.267 Latest v2.1.280 Next v2.1.280 Feeds RSS JSON llms.txt Unofficial
Claude Code v2.1.271 ·

git worktree list parsing gets duplicate-path and NUL-separated output handling

Parsing of git worktree list --porcelain output is now checked for duplicate paths and can use NUL-separated output for safety

TierUnder the hoodhow much it should matter to you
Useful2my rating, 1 to 5
Signal1worth watching, 1 to 5
AreaWorktreeswhat it touches
KindInternal Changesin v2.1.271,
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 -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.

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.

See this entry in the whole of v2.1.271 →

Feedback