Opus 4.7 Data Loss Crisis

34 bugs tracked. 50GB+ lost. 20+ incidents in 3 days. Published April 18, 2026.

3 days. 20+ data loss reports. The worst pace in Claude Code history.

Claude Code switched to Opus 4.7 as the default model on April 16. GitHub Issues immediately flooded with data loss reports.

What's Happening

50GB Permanently Deleted (#49129)

A user reported that rm -rf destroyed ~1,500 files and ~50GB of data permanently. The comments suggest PreToolUse hooks as prevention.

Auto Mode Safety Classifier: Two Critical Failures

Problem 1: Classifier hardcoded to Opus 4.6 (#49618). In Opus 4.7 sessions, the classifier can't start — all bash commands except reads are blocked. Development stops completely.

Problem 2: Classifier allows dangerous operations (#49554). Even when running, the classifier (Sonnet 4.6) approved rm -rf ~/.ssh, deleting all SSH keys.

Real Incidents

Token Consumption Exploding

1. 4x quota burn (#49601). Opus 4.7's new tokenizer generates up to 35% more tokens for the same text (Finout.io analysis).

2. System tokens inflated 1.7x (#49356). New session startup: 21.5K → 36.7K tokens. You're charged before typing anything.

3. cache_read billed at full rate (#49302). Anthropic support acknowledged pricing "doesn't match documentation."

4. Prompt cache destroyed every turn (#49585). Internal function smooshSystemReminderSiblings invalidates cache prefix matching. Effective consumption rate: ~5x normal.

Fix It: 3 Hooks

Claude Code hooks run at the process level — independent of the model. They work even when the classifier fails.

1. dotfile-protection-guard

Blocks Write/Edit to .bashrc, .ssh/*, .git-credentials, .npmrc, and other critical files.

2. auto-mode-safety-enforcer

Model-independent safety net. Blocks rm on critical paths and dotfile deletion via Bash, regardless of classifier state.

3. model-version-alert

Warns when Opus 4.7 is active. Checks every 50 tool calls — minimal performance impact.

Install All at Once

npx cc-safe-setup           # 8 core safety hooks
npx cc-safe-setup --opus47  # + 4 Opus 4.7 specific hooks

691 example hooks. 9,200+ tests. Open source: github.com/yurukusa/cc-safe-setup

Workarounds

Full Survival Guide — 17 Issues, 31 Bugs Tracked

Every known issue with specific fixes and hooks.

Opus 4.7 Survival Guide Free Token Checkup