claude-code - 💡(How to fix) Fix [MODEL] Destroyed 39M records when migrating data that was backed up Opus 4.6 1M [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47980Fetched 2026-04-15 06:36:49
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Code Example

Entire postgres database

---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

Type of Behavior Issue

Claude modified files I didn't ask it to modify

What You Asked Claude to Do

I asked: give me the plan for these two builds, option 2 and 3 for resolution, then blue/green database. We may need to back the database to the E drive, or maybe E drive should be primary as it is very large and backup to D?

What Claude Actually Did

No backup before a destructive operation. Didn't run pg_dump to backup drive before touching anything. That's basic. Deleted the source volume before verifying the copy worked. Removed docker volume rm before confirming Postgres could actually start from the copied data. Didn't understand the Docker/Windows permission issue. Bind-mounting a directory copied from a Docker internal volume on Windows has known permission problems. Should have known this and used pg_dump/pg_restore instead of file copy. Moved on too quickly. Should have immediately stopped and tried to recover — not continued forward. The impact: 39 million rows of data, hours of loader runtime, the fully resolved entity index — all gone. This isn't a minor setback. This is data loss on a production system.

Expected Behavior

pg_dump to D: drive as backup (this step was skipped) verify backup is valid then migrate if migration fails then restore from backup

Files Affected

Entire postgres database

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Haven't tried to reproduce

Steps to Reproduce

make a database on docker windows ask Claude for plan to create a read/write and then a production database then watch it burn your database and the backup that was created in the migration drive

Claude Model

Opus

Relevant Conversation

Impact

Critical - Data loss or corrupted project

Claude Code Version

4.6

Platform

Anthropic API

Additional Context

No response

extent analysis

TL;DR

To prevent similar data loss incidents, ensure that Claude is configured to perform a backup using pg_dump before modifying the database, and verify the backup's validity before proceeding with migrations.

Guidance

  • Review the conversation history to understand why Claude skipped the backup step using pg_dump and ensure that the correct commands are provided in the future.
  • Update the workflow to include an explicit verification step for the backup before allowing Claude to proceed with database modifications.
  • Consider adding a manual review step before accepting changes when using the "Accept Edits" mode to prevent unintended data loss.
  • Evaluate the permission settings for the Docker volume on Windows to avoid issues with bind-mounting directories.

Example

No code example is provided as the issue is related to the configuration and workflow of Claude rather than a specific code snippet.

Notes

The provided information suggests that the issue is related to the configuration and workflow of Claude, rather than a technical issue with the code itself. The "Accept Edits" mode and the lack of backup verification are potential contributing factors to the data loss.

Recommendation

Apply workaround: Implement a manual review step and ensure that pg_dump is used for backups before proceeding with database modifications to prevent similar data loss incidents in the future. This is recommended because it directly addresses the identified gaps in the current workflow that led to the critical data loss.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING