Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.304 ·

Leaving or removing a worktree now spells out what is at stake

Worktree exit and removal now report what is at stake, handle a detached HEAD, and refuse to quietly delete worktrees nested inside

Group of 4 You'll notice Improvements
JSON All of v2.1.304
You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
3Signal: worth watching, 1 to 5
WorktreesArea: what it touches
ImprovementsKind: in v2.1.304,
ImprovementsSection of the release

What

A worktree is a separate working copy of your project that Claude Code can create for a session. The checks and messages shown when you leave or remove one were reworked:

  • The summary of what would be lost no longer runs a plain git rev-list --count of commits. A new helper returns the commits plus an atStake record of what is at risk. It returns nothing when the branch to keep is unknown.
  • The exit dialog now handles a detached HEAD, which means the worktree is not on any named branch. It says "with HEAD detached" and "or the detached HEAD", and words differently whether commits will be lost or kept.
  • New messages include "Worktree removed (no changes)" and a note that the worktree "is kept" when it was on another branch.
  • Deleting a background session's worktree that contains other worktrees now gives its own reason, worktrees_inside, instead of a generic failure. The message says "worktree may hold other worktrees - ctrl+x again deletes them" and tells you to move out anything you need first.
  • The usage report sent when a worktree is kept now includes the number of changed files and the at-stake details: the head state, the commits on the kept branch and the worktrees inside. Before, it sent only a plain commit count.

A new path that keeps the worktree at removal time (kept_at_removal) was added. In this build the function that decides it, eMe, always returns nothing, so that path never runs. The rewind dialog also gained a redesign branch that is switched off in the code itself and sets a subtitle.

Why

Exit warnings now describe more accurately what you stand to lose, including when HEAD is detached. A worktree that holds other worktrees is no longer deleted on the first try without a specific warning. The keep-at-removal behaviour is built but cannot be reached yet.

See this entry in the whole of v2.1.304 →

Feedback