Follow Discord
Sweep 01 Oct 2026 · 17:27Z Build v2.1.287 508 read Stable v2.1.285 Latest v2.1.287 Next v2.1.287 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.286 ·

Worktree removal on exit now runs after the session ends

Choosing to remove a worktree when you exit now runs the removal during shutdown, can be interrupted, and reports if it was skipped

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

What

A worktree is a separate working copy of your git repository that a Claude Code session can work in. When you leave a worktree session you can remove it, and a clean worktree can be removed automatically. That removal now runs during Claude Code's shutdown instead of inside the exit dialog.

  • Choosing 'Remove worktree', or the automatic removal of a clean worktree, no longer holds up the dialog for worktrees not created by a hook. The removal is handed off as a removeWorktree step that runs after the session ends. Before, the dialog waited for the removal and then showed the result.
  • Worktrees created by a hook are still removed right away, inside the dialog.
  • During shutdown, removeWorktreeAtExit prints "Removing worktree…" and runs with a time budget of at least 5 seconds.
  • Pressing Ctrl+C or receiving a stop or hang-up signal (SIGINT, SIGTERM, SIGHUP) interrupts the removal, and a message warns that the folder may be partly deleted.
  • When a tmux session is being closed and TMUX and CLAUDE_CODE_TMUX_SESSION match, the removal ignores the hang-up signal.
  • If the session had switched away from that worktree, removal is refused with "Worktree not removed: this session had switched away from it before Claude Code exited".
  • If a shutdown is already under way and a second request asks to remove a different worktree, a warning is logged that the worktree was kept. Before, this was silently dropped.
  • The hint for resuming the session can now leave out the worktree once it has been removed (resumeHintOmitsWorktree).

Why

Exiting is quicker, but the result of the removal now appears after the dialog closes. If a worktree is left behind, the new messages say why, and an interrupted removal can leave a partly deleted folder to clean up.

How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtWhen removal ignores a lost terminal and when the resume hint leaves out the worktree is not clear.

See this entry in the whole of v2.1.286 →

Feedback