Worktree cleanup now writes a CLAUDE_BASE marker to track the baseline commit, enabling accurate detection of commits ahead and uncommitted changes when deciding whether to auto-clean a worktree.
Evidence
Worktree baseline tracking (search for "CLAUDE_BASE", "commitsAhead=")
Strings lifted out of the shipped bundle, so the claim above can be checked against them.