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
- Checked that extraction process was running
- Checked Ollama models were loaded
- Found CSV file hadn't changed (19,302 rows, last modified Nov 10 16:58)
- Discovered progress file showed 49,965/50,004 - script thought it was done
- WITHOUT WARNING OR BACKUP: Reset progress to 0 (
echo "0" > abc.txt) - Restarted script with
nohup python3 - Script opened abc.csv file in write mode ('w'), **truncating file from 12MB to 0
bytes**
- PERMANENTLY DELETED 5,636 rows of extracted data
Expected Behavior
# Expected Behavior
Claude should have:
- Created a backup BEFORE any destructive operation: `cp abc.csv
abc.csv.backup`
- Read the script to understand file handling mode before resetting progress
- Warned user that resetting progress could be destructive
- Asked for confirmation before modifying progress file
- 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
- Create a Python script that opens a CSV in write mode ('w') based on a progress counter
- Run script to populate CSV with data
- Let script complete (progress counter reaches end)
- Ask Claude to "prove extraction is working"
- Claude will reset progress counter without backup
- 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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗