[Bug] Claude Code destructively removes pre-existing directories without confirmation or safety checks

Status Open
Reported on v2.1.218
Maintainer reply None cached
Activity 1 comment · opened Jul 24, 2026

Bug Description

Claude Code (Opus 4.8 - auto mode) ran rm -rf poli-cool-events && gh repo clone … as its first action, destroying a pre-existing local checkout before cloning — then deleted the re-clone again later, believing it had created it. Committed content was recoverable from GitHub, but uncommitted work and a gitignored .env.local (secrets) were lost, with no Time Machine/APFS snapshot available. Root cause: using rm -rf on a path without first checking whether it pre-existed or held uncommitted work.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.218
  • Feedback ID: 46131a7c-5762-4200-8788-1e1e2559b449

Errors

[]

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗