New checks more reliably detect genuine git worktrees, including broken links on Windows
Claude Code now has more thorough logic for detecting git worktrees (linked copies of a git repository that share history). It parses the output of git worktree list to confirm a directory is a genuine, uniquely matching worktree, normalizes file paths (handling macOS's Unicode normalization and trailing slashes), and on Windows walks up parent directories checking for reparse points or .lnk shortcut files to determine whether a worktree link is "clear", "missing", or otherwise broken.
This makes worktree detection more reliable across platforms, particularly on Windows where symbolic-link-like mechanisms work differently, reducing false positives or negatives when Claude Code needs to know whether it's operating inside a worktree.