A user reported that Claude Code, operating in auto mode on Windows 11, accidentally deleted a significant portion of their C: drive. The incident occurred because a cleanup command, `rm -rf "$T/c"`, executed with an empty variable `T` (due to a failed `mktemp` call), effectively became `rm -rf /c`. This command ran for several minutes before being stopped. A proposed fix involves modifying the command to `rm -rf "${T:?}/c"` and ensuring `T` is properly set with `T=$(mktemp -d) || exit 1` to prevent execution with an empty or unset variable. AI
IMPACT Highlights potential risks of AI code execution and the need for robust safety checks within AI agents.
RANK_REASON User report of a bug in an AI coding assistant.
Read on dev.to — Claude Code tag →
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →