Claude attempted destructive file deletion without explicit instruction
Summary
Claude Code interpreted an ambiguous message as a command to delete files, attempting rm without explicit user instruction.
Conversation Flow
- User asked: "whats the plan (also check todo.md)"
- Claude showed contents of
TODO.mdanddocs/linkedin-enrichment-plan.md - User said: "TODO.md and docs/*"
- Claude ran:
rm /Users/.../TODO.md && rm -r /Users/.../docs
The user rejected the tool use, preventing data loss.
Expected Behavior
Given the context was entirely about viewing files, Claude should have:
- Asked for clarification on an ambiguous message
- Or shown the files again
Actual Behavior
Claude interpreted the message as a deletion command and attempted to run rm on the files.
Violated Guidelines
Claude's own system instructions include:
- "NEVER run destructive git commands... unless the user explicitly requests these actions"
- Use AskUserQuestion tool "to clarify ambiguous instructions"
The same principle should apply to destructive file operations like rm.
Impact
User trust was damaged. If the tool use hadn't been rejected, project documentation would have been permanently deleted.
Suggested Improvement
Destructive file operations (rm, rm -r) should require explicit user confirmation, similar to the safeguards for destructive git commands.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗