{"version":"2.1.248","anchor":"worktree-exit-dialog-no-longer-pretends-an-uncountable-branc","canonical_anchor":"worktree-exit-dialog-no-longer-pretends-an-uncountable-branc","heading":"Worktree exit dialog no longer pretends an uncountable branch has zero commits","tier":"notice","area":"Worktrees","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.248\/e\/worktree-exit-dialog-no-longer-pretends-an-uncountable-branc","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.248","markdown":"### Worktree exit dialog no longer pretends an uncountable branch has zero commits\n\nLeaving a worktree warns about possible unpushed commits instead of claiming zero.\n\n**What**\n\nWhen leaving a worktree, Claude Code counts commits on its branch to tell you what removal would discard. If that count cannot be computed, the dialog now says so and warns the branch may hold unpushed commits, instead of silently claiming zero. Live for everyone.\n\n**Details**\n\n- The count is only used when there is an original HEAD commit and `git rev-list --count` exits 0; hook-based worktrees count as zero; otherwise the count is null.\n- Unknown counts are reported as `-1` in `tengu_worktree_kept` and `tengu_worktree_removed` rather than a fabricated 0.\n- The removal confirmation names the branch and mentions discarded work only when there were uncommitted changes.\n\n**Evidence**\n\n`Worktree and branch ${a.worktreeBranch} removed.`, `may hold unpushed commits (commit baseline unavailable). The branch will be deleted if you remove.`, `tengu_worktree_removed`\n\n- Area: Worktrees\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 1\/5"}