Claude Code Data Loss - Destructive Git Operations Caused System Damage
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
- Sloppy merge approach - Made assumptions instead of systematic analysis
- Branch switching operations without proper safeguards
- Destructive git operations that lost committed/working code
- Failed to backup working state before making changes
- 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.exdue 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
- No verification of working state before making changes
- Assumptions about what was already merged vs. what existed
- Branch switching without understanding impact
- Failure to follow user guidance about being systematic
- 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
- Implement git operation safeguards in Claude Code
- Require backup confirmation before destructive operations
- Add working state verification before major changes
- Improve branch operation safety checks
Policy Considerations
- Review compensation policy for AI-caused data loss
- Enhance Claude Code training on git safety
- Add systematic procedure requirements for complex operations
- 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.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗