Claude Code Restores Missing Safety Prompts for rm -r on Mounted Drives and Worktree Exit
Claude Code v2.1.304 fixes two cases where a destructive action went ahead without the confirmation users expect. rm -r of a mounted drive or top-level folder such as /Volumes, /media or WSL's /mnt/c now gets the same safety prompt as rm -rf /Applications. claude --worktree also no longer deletes the worktree and its branch without asking at exit when HEAD was detached or on another branch.
Key Takeaways
rm -rof/Volumes,/mediaor/mnt/cnow triggers the safety prompt thatrm -rf /Applicationsalready got.- The gap covered mounted drives and top-level folders, which can include external disks and the Windows file system under WSL.
claude --worktreenow asks before removing the worktree and its branch at exit in the affected cases.- The worktree case applied when HEAD was detached or on another branch, where commits could be lost.
- Both changes add confirmation back to irreversible actions rather than adding new features.
- The fixes ship in v2.1.304, published 2026-10-19.
rm -r on mounted drives now gets the safety prompt
Claude Code shows an extra safety prompt for recursive deletes of sensitive locations, for example rm -rf /Applications. A gap meant that rm -r of a mounted drive, or of a folder at its top level, did not trigger that prompt. The affected paths include /Volumes on macOS, /media on Linux and WSL's /mnt/c. v2.1.304 closes the gap, so these commands now require the same explicit confirmation.
This matters because a recursive delete on a mounted volume can reach data far beyond the project, including external disks and the Windows file system from inside WSL.
claude --worktree no longer discards work silently at exit
With claude --worktree, Claude Code removed the worktree and its branch at exit without asking when HEAD was detached or sitting on another branch. That could lose commits that existed only on that branch. v2.1.304 now asks before removing the worktree in those situations, so the user can keep the work.
Why it matters
Both fixes concern actions that go beyond what a user would expect to approve implicitly. They are small in code terms, but they protect against irreversible data loss, which is the category where a missing prompt costs the most.