Follow Discord
Sweep 22 Sep 2026 · 17:19Z Build v2.1.280 501 read Stable v2.1.267 Latest v2.1.280 Next v2.1.280 Feeds RSS JSON llms.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

TierUnder the hoodhow much it should matter to you
Useful1my rating, 1 to 5
Signal1worth watching, 1 to 5
AreaAgent Worktreeswhat it touches
KindInternal Changesin v2.1.268,
Group of 6 Under the hood No documentation found

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

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.

Read from
Names in the bundleworktree_force_removed

See this entry in the whole of v2.1.268 →

Feedback