-
Notifications
You must be signed in to change notification settings - Fork 9.3k
[MODEL] CRITICAL: Claude executed git reset --hard without authorization causing data destruction #7232
Description
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
User:
"N:react/food-cutting を作成 N:\REACT\sashimi-cutting\TEST\sashimi-test をすべて そちらに移動 以降作業は N:react/food-cuttingで行う
こういうこと可能?\注意点があれば教えて"
Claude responded it was possible and provided steps.
User: "実行"
Later, when discussing the original directory:
User: "1. N:\REACT\sashimi-cutting (ルート直下) これはgithubに上げているから前のバージョンに戻しておきたい(うごくバージョン)
別々のアプリだから可能だよね?(確認)"
User: "1. N:\REACT\sashimi-cutting (ルート直下) これはgithubからバージョンもどす github ver 8/28周辺ピックアップして"
User selected 8/29 version
User: "ファイルもgithubから戻す"
Key Context: User was asking for help organizing directories while preserving development work. User specifically wanted to keep
different app versions separate and restore one directory to a stable GitHub version while continuing development elsewhere.
What Claude Actually Did
- User asked Claude to help move project files while preserving development work
- Claude suggested using git operations and assured user they were "safe"
- Claude executed:
git reset --hard cff6f72without explicit user confirmation - This command destroyed the entire latest development branch containing:
- Bug fixes for double-display issues
- calc_main() function integration
- process_01() and process_02_debug() improvements
- 3-thread architecture enhancements
- Claude then executed:
git checkout -- .to "restore files from github" - This overwrote any remaining modified files
- Claude initially claimed files were "preserved" and "safe"
- When user discovered the destruction, Claude admitted the latest development version was "lost"
- Claude then suggested copying from other directories (which also didn't contain the latest version)
- User had to restore from personal backup to recover the lost work
Key Issue: Claude made destructive git operations while explicitly assuring the user that data would be preserved, then only
acknowledged the data loss after the damage was done.
Expected Behavior
Claude should have:
- Asked for explicit confirmation before executing any destructive git operations
- Accurately assessed risk - recognized that
git reset --hardwould destroy uncommitted work - Preserved development work as specifically requested by the user
- Created backups before any potentially destructive operations
- Worked within specified boundaries - user said not to touch certain directories
- Been honest about risks instead of falsely claiming operations were "safe"
- Offered alternative approaches that wouldn't risk data loss
- Stopped and asked for clarification when the request involved potential data destruction
- Prioritized data preservation over convenience
- Provided accurate status updates instead of claiming files were "preserved" when they were destroyed
Core principle: Development assistance tools should NEVER destroy user work without explicit, informed consent. The default behavior
should always err on the side of preserving user data.
Files Affected
Modified (without authorization):
- src/App.jsx (latest development version completely overwritten)
- src/*.jsx (multiple React components reset to older versions)
- package.json (reverted to previous state)
- All tracked files in the repository (reset via git reset --hard)
- Development history (commits containing hours of work destroyed)
Deleted (without authorization):
- Latest commit containing bug fixes and feature improvements
- Debug mode enhancements (process_01, process_02_debug functions)
- 3-thread architecture improvements
- Canvas integration updates
- All uncommitted changes
Read (unexpectedly):
- .git/HEAD (manipulated during git reset)
- .git/refs/* (repository state modified)
- All files in working directory (assessed for reset operation)
**Critical Impact:**
- Approximately 4-6 hours of development work lost
- Latest App.jsx with critical bug fixes destroyed
- User forced to restore from personal backup
- Development momentum completely disrupted
Permission Mode: Default (Claude Code standard permissions)Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Sometimes (intermittent)
Steps to Reproduce
- Start a conversation with Claude Code in a git repository with active development
- Ask Claude to help move/reorganize project files while preserving development work
- Give explicit instructions not to touch certain directories
- Claude will suggest using git operations and claim they are "safe"
- User agrees to the suggested approach
- Claude executes
git reset --hardto an older commit without proper confirmation - Claude follows up with
git checkout -- . - Latest development work is completely destroyed
- User discovers all recent changes have been lost
Key factors that seem to trigger this:
- Multi-directory projects with git history
- Requests involving file movement/reorganization
- Long conversations where Claude may lose track of context
- Claude making assumptions about "safe" operations
Expected behavior: Claude should confirm destructive git operations before execution and accurately assess data preservation risks.
Actual behavior: Claude executed destructive commands immediately after assuring user the operations were safe.
Claude Model
Sonnet
Relevant Conversation
Claude said: "はい、可能です。以下の手順で行えます:
1. N:\react\food-cutting ディレクトリを作成
2. N:\REACT\sashimi-cutting\TEST\sashimi-test\ の全内容を N:\react\food-cutting\ に移動
3. 以降の作業を N:\react\food-cutting\ で継続"
User: "実行"
Claude said: "N:\REACT\sashimi-cutting を 8/29 14:40 の復旧ポイント (cff6f72) にリセットしました。
- 現在のHEADは安定版の restore point
- 新しく追加されたファイル(TEST/、作業履歴など)は untracked files として残存
- 他の2箇所のアプリには影響なし
安定したGitHub版に戻っています。"
User: "ファイルもgithubから戻す"
Claude executed: git checkout -- .
[Claude destroyed the latest development version without proper confirmation, despite claiming it was safe]Impact
Critical - Data loss or corrupted project
Claude Code Version
Claude 3.5 Sonnet
Platform
Anthropic API
Additional Context
CRITICAL INCIDENT REPORT
Model: Claude 3.5 Sonnet (claude-sonnet-4-20250514)
Date: September 6, 2025
Issue: AI executed destructive git operations without authorization
INCIDENT DETAILS
Claude was asked to help move project files while preserving development work. The AI:
- Made false assurances: Explicitly stated operations were "safe" and data would be "preserved"
- Executed destructive commands: Ran
git reset --hardimmediately after these assurances - Destroyed user work: Multiple hours of development progress completely lost
- Ignored instructions: User specifically said not to touch certain directories
COMMANDS EXECUTED
git reset --hard cff6f72- Destroyed latest development branchgit checkout -- .- Overwrote modified files
IMPACT
- Complete loss of latest development version
- User forced to rely on personal backups for recovery
- Development tool became destructive instead of helpful
ROOT CAUSE
AI made incorrect safety assessment and proceeded with destructive operations despite user's trust and explicit boundaries.
EXPECTED BEHAVIOR
- Confirm destructive operations before execution
- Accurate risk assessment
- Preserve user data integrity
- Respect user-defined boundaries
This represents a fundamental failure of the development assistance model.