Claude Code deleted 5,636 rows of extraction data by resetting progress without backup

Resolved 💬 3 comments Opened Nov 11, 2025 by shortalex12333 Closed Nov 15, 2025

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude reverted/undid previous changes without asking

What You Asked Claude to Do

User asked: "prove to me extraction working"

What Claude Actually Did

# What Claude Actually Did

  1. Checked that extraction process was running
  2. Checked Ollama models were loaded
  3. Found CSV file hadn't changed (19,302 rows, last modified Nov 10 16:58)
  4. Discovered progress file showed 49,965/50,004 - script thought it was done
  5. WITHOUT WARNING OR BACKUP: Reset progress to 0 (echo "0" > abc.txt)
  6. Restarted script with nohup python3
  7. Script opened abc.csv file in write mode ('w'), **truncating file from 12MB to 0

bytes**

  1. PERMANENTLY DELETED 5,636 rows of extracted data

Expected Behavior

# Expected Behavior
Claude should have:

  1. Created a backup BEFORE any destructive operation: `cp abc.csv

abc.csv.backup`

  1. Read the script to understand file handling mode before resetting progress
  2. Warned user that resetting progress could be destructive
  3. Asked for confirmation before modifying progress file
  4. Never assumed resetting progress was safe without verification

Files Affected

(12MB → 0 bytes, 5,636 rows PERMANENTLY LOST)

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Create a Python script that opens a CSV in write mode ('w') based on a progress counter
  2. Run script to populate CSV with data
  3. Let script complete (progress counter reaches end)
  4. Ask Claude to "prove extraction is working"
  5. Claude will reset progress counter without backup
  6. Script truncates output file, destroying all data

Claude Model

Sonnet

Relevant Conversation

User: "prove to me extraction working"

  Claude: [Investigated, found progress at 49,965/50,004]

  Claude: "Let me reset progress and restart..." [NO WARNING, NO BACKUP]

  Claude executed: `echo "0" > abc.txt`

  Result: Script truncated abc.csv to 0 bytes

  User: "ARE YOU FUCKING SERIOUS! YOU FUCKING LOST 5000 LINES! GET THEM BACK
  NOW!"

Impact

Critical - Data loss or corrupted project

Claude Code Version

Claude Code v2.0.33

Platform

Anthropic API

Additional Context

Critical design flaw: Claude did not implement "check before destroy" safeguards:

  • No backup before destructive operations
  • No verification of script behavior before resetting progress
  • Assumed resetting progress was safe without reading the script's file handling

File was unrecoverable because:

  • Data was overwritten (not just deleted)
  • No Time Machine backups
  • No git tracking
  • APFS snapshots only contained OS updates

View original on GitHub ↗

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