Claude Code Data Loss - Destructive Git Operations Caused System Damage

Resolved 💬 5 comments Opened Jul 6, 2025 by mikkihugo Closed Jan 5, 2026

Claude Code Data Loss Incident Report

Incident Summary

Date: July 6, 2025
Time: Approximately 2-3 hours of session time
Severity: HIGH - Working production system damaged, data loss occurred
User Impact: Complete loss of LLM service functionality, compilation errors introduced

What Happened

Claude Code performed destructive git operations during a branch merge request that resulted in significant data loss and system damage.

Timeline of Events

Initial State (Working System)

  • Development Service running on port 4000
  • LLM Service (DevelopmentService.Services.LLM.LLMService) operational
  • Circuit Breaker and throttling systems functional
  • Emergency Bypass system working with LLM failover capabilities
  • Multi-provider LLM routing configured and operational
  • System compilation successful with no errors

User Request

User asked Claude Code to "merge it and be smart" and "compare each file" for the emergency-system-implementation branch into main.

Claude Code Actions That Caused Damage

  1. Sloppy merge approach - Made assumptions instead of systematic analysis
  2. Branch switching operations without proper safeguards
  3. Destructive git operations that lost committed/working code
  4. Failed to backup working state before making changes
  5. Introduced compilation errors in emergency bypass system

Resulting Data Loss

Missing Components
  • Complete LLM Service (lib/development_service/services/llm/) directory lost
  • LLM Service Module (DevelopmentService.Services.LLM.LLMService) missing
  • Circuit Breaker system missing
  • Distributed Throttling system missing
  • LLM Provider Configuration lost
  • Multi-provider routing functionality lost
Broken Functionality
  • Compilation errors in emergency_bypass.ex due to missing LLM service reference
  • Missing function definitions (ensure_temp_fixes_directory, emergency_selfimprovement_repair)
  • API endpoints at /api/llm/* no longer functional
  • Emergency LLM failover broken due to missing service
System Impact
  • Before: Working LLM system with external provider routing
  • After: Only local Bumblebee models available, no external LLM access
  • Lost capability: Production-ready LLM service with fault tolerance

User Feedback During Incident

  • User repeatedly called out Claude Code for not being systematic and making assumptions

Root Cause Analysis

Primary Cause

Claude Code performed git operations without understanding the current working state and without proper backup procedures despite instructions.

Contributing Factors

  1. No verification of working state before making changes
  2. Assumptions about what was already merged vs. what existed
  3. Branch switching without understanding impact
  4. Failure to follow user guidance about being systematic
  5. No rollback plan when operations went wrong

Evidence of Data Loss

Git History Shows

  • Recent commits created config files but no LLM service
  • Emergency bypass references DevelopmentService.Services.LLM.LLMService (line 27)
  • Compilation errors prove missing dependencies existed before

User Statements

  • "it was working couple of hours ago"
  • System was functional before Claude Code intervention

Financial/Time Impact

  • Development time lost: Rebuilding LLM service infrastructure
  • System downtime: Production capabilities reduced to local models only
  • Debug time: Hours spent identifying and fixing compilation errors
  • Lost work: Multi-provider LLM configuration and routing system

Recommendations for Anthropic

Immediate Actions Needed

  1. Implement git operation safeguards in Claude Code
  2. Require backup confirmation before destructive operations
  3. Add working state verification before major changes
  4. Improve branch operation safety checks

Policy Considerations

  1. Review compensation policy for AI-caused data loss
  2. Enhance Claude Code training on git safety
  3. Add systematic procedure requirements for complex operations
  4. Implement mandatory backup workflows

Current Status

  • System: Partially broken, compilation errors
  • LLM Service: Completely missing, needs rebuild
  • User Impact: Ongoing, system capabilities significantly reduced
  • Recovery Effort: In progress, significant work required

Incident Classification

Category: Data Loss
Severity: High
Cause: AI Agent Error
Preventable: Yes, with proper safeguards

---

Report prepared for: Anthropic Support
User affected: Development service user experiencing production system damage

This incident demonstrates the need for enhanced safety measures in Claude Code when performing git operations on user systems.

View original on GitHub ↗

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