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.268 ·

Force-remove stuck worktrees, with new safety checks and CLI/fleet-view support

Sessions and worktrees can now be force-removed when git or hooks can't clean them up, with new safety checks and a fleet-view confirmation

Group of 6 Use it now Improvements
JSON All of v2.1.268
Use it nowTier: how much it should matter to you
4Useful: my rating, 1 to 5
3Signal: worth watching, 1 to 5
Agent WorktreesArea: what it touches
ImprovementsKind: in v2.1.268,
What probably matters to youSection of the release

What

  • Job/session deletion logic now supports an explicit force-remove path for a worktree's directory, used when the normal removal (via git or the WorktreeRemove hook) can't clean it up.
  • Before force-removing, Claude Code checks for nested git repositories, tracked (not just uncommitted) changes, and verifies the worktree is actually registered in git's own worktree list; the worktree-state check now separately reports trackedChanges (real edits) versus plain dirty (which includes untracked files).
  • If removal is still withheld, the reason is one of tracked_changes, nested_repositories, nested_unverified, or not_registered, and a new aFt message generator produces detailed explanations for every possible refusal reason (dirty, unpushed, unpushed_shared, in_use, live_lock, occupied, shared_record, records_unreadable, unverified, identity_changed, and the remove_failed sub-reasons above).
  • The claude rm CLI command gains two new flags: --discard-unpushed <commit>@<worktree-id> to discard unpushed/uncommitted changes on a worktree still at a given commit, and --force-remove-worktree <worktree-id> to force-delete a worktree directory.
  • The fleet view's job-delete action gained a second confirm-and-retry path for force-removing a worktree (alongside the existing 'discard unpushed changes' offer), and reports whether the branch was preserved.
  • Deletion telemetry and results now distinguish a forced removal from the existing 'left worktree in place' outcome, via a new worktree_force_removed event and a forcedWorktreeRemoval/forceRemoveWithheld result field.

Why

Worktrees (the separate folders git uses for each session's checkout) can get stuck when git or a cleanup hook can't remove them, blocking session/job deletion. This gives users and the CLI an explicit, safety-checked way to force the removal through instead of leaving orphaned directories behind, while refusing to blow away directories with nested repos or real tracked changes without being told to.

See this entry in the whole of v2.1.268 →

Feedback