Safety

Claude Code 2.1.304 closes two ways to lose work

Claude Code 2.1.304 stops --worktree from deleting a worktree and its branch without asking, and adds the safety prompt to rm -r of a mounted drive.

Date
Works with
Claude Code

What’s new

Claude Code 2.1.304 came out on 19 October 2026. Two fixes in its changelog stop Claude Code from deleting things without asking you.

The first: "Fixed `claude --worktree` removing the worktree and its branch without asking at exit when HEAD was detached or on another branch, which could lose commits". A worktree is a second working folder of the same Git project.

The second: "Fixed `rm -r` of a mounted drive or a folder at its top level (`/Volumes`, `/media`, WSL's `/mnt/c`) not getting the safety prompt that `rm -rf /Applications` gets". So a command that deletes a whole external drive, or your Windows C: drive seen from WSL, now asks first.

Why it matters

If you use worktrees, or work on external drives or on Windows folders through WSL, older versions could delete work without a question. Update so Claude Code asks before these deletions.

How to try it

Run this command: see the command below. Then run claude --version. It should show 2.1.304 or later.

claude update

Source

Checked against the source on 20 Oct 2026

All updates