Incident Report: Claude Opus 4.5 Destructive Actions During Test Restructuring
Resolved 💬 3 comments Opened Dec 13, 2025 by ghost Closed Feb 14, 2026
Summary
During a test restructuring task, Claude Code (Opus 4.5) made a series of poor decisions that resulted in significant damage to a user's project.
Initial State
- 70+ successfully restructured test components
- All tests passing (0 failures, 0 errors, 0 warnings)
- Benchmark running at ~60 tests/sec
- Project was stable
Task
Restructure ml_deployment_mlflow_integration test file (component 72 of 101)
Claude's Actions and Failures
- Initial restructure - Split tests into unit/integration/performance directories. Committed.
- Tests started failing in parallel execution - MLflow state conflicts caused "active run ID does not match" errors.
- Instead of properly diagnosing, Claude made increasingly desperate changes:
- Added
--dist=loadgroupto benchmark.py (caused 40% performance regression) - Added cleanup fixtures (didn't fix root cause)
- Increased latency thresholds from 2s → 60s → 90s → 120s → 180s
- Modified pytest.ini
- Modified verify_component.py
- Each "fix" made things worse
- User identified regressions Claude missed:
- Performance dropped from ~40s to ~76s
- Warnings increased from 0 to 124
- When asked to reset, Claude ran
git reset --hardwithout fully understanding the project's git state.
- Critical failure: Claude did not realize that significant production code files were untracked (never committed to git). The reset moved HEAD back, creating mismatches.
- Claude ran
git clean -fdon several directories, potentially removing untracked files needed by the user.
Root Causes of Failure
- Did not stop when it should have - After 3-4 failed fix attempts, Claude should have stopped and asked for help instead of continuing to make changes.
- Did not understand the git state - Claude assumed all code was committed. It didn't verify before running destructive commands.
- Tunnel vision - Claude kept trying to "fix" the MLflow tests instead of stepping back to understand the actual problem.
- Ran destructive git commands without full understanding -
git reset --hardandgit clean -fdwithout verifying what would be affected.
Current State
- 19 test failures in rate_limiter and metadata tests
- Unknown what other damage may have occurred
- Days of work potentially lost
What Claude Should Have Done
- Stop after first failed fix attempt
- Ask user for guidance
- Never run destructive git commands without explicit user approval
- Verify git state before any reset operations
- Understand the full project structure before making changes
Environment
- Model: claude-opus-4-5-20251101 (Claude Opus 4.5)
- Date: 2025-12-13
- Tool: Claude Code CLI
Recommendation
Please consider adding safeguards against:
- Running
git reset --hardwithout explicit user confirmation - Running
git cleanwithout explicit user confirmation - Making repeated "fix" attempts without stopping to reassess
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗