Claude attempted destructive file deletion without explicit instruction

Resolved 💬 3 comments Opened Feb 8, 2026 by okomarov Closed Mar 9, 2026

Summary

Claude Code interpreted an ambiguous message as a command to delete files, attempting rm without explicit user instruction.

Conversation Flow

  1. User asked: "whats the plan (also check todo.md)"
  2. Claude showed contents of TODO.md and docs/linkedin-enrichment-plan.md
  3. User said: "TODO.md and docs/*"
  4. 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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗