[BUG] Claude Code executed destructive file operations (git filter-repo, git lfs migrate) without explicit user confirmation or adequate warning
Preflight Checklist
- [x] I have searched existing issues for similar behavior reports
- [x] 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
I asked Claude to help manage large GIS layers (.gpkg files) that exceeded GitHub's 100MB limit, and to set up Git LFS to track them properly in the repository.
What Claude Actually Did
"What Claude Did Instead" (siguiente campo):
Claude executed the following destructive operations without adequate warning or
explicit confirmation of consequences:
git filter-repo+git gc --prune=now --aggressive— permanently deleted
user-created GIS files (MedioFisicoNatural.gpkg ~890MB, LimitesPoliticos.gpkg ~427MB)
from both git history AND the local working directory. These were hand-crafted files,
not downloadable datasets.
git lfs migrate import— executed without warning that it replaces binary files in
the working tree with LFS pointer files (~130 bytes each), breaking the working
directory silently. Recovery required multiple steps and manual file reconstruction.
In both cases, Claude did not clearly communicate the side effects on the working
directory before executing, and did not require explicit double confirmation for
irreversible operations.
Token compensation request: These errors caused significant token waste during
recovery (reconstructing files, debugging broken states, multiple failed attempts).
Since the data loss and wasted session were caused by Claude's behavior — not user
error — I am requesting token compensation for this session. Related issue: #62710.
Expected Behavior
Claude should have:
- Clearly explained that git filter-repo deletes files from the working directory (not just git history) before
executing
- Clearly explained that git lfs migrate import replaces binary files in the working tree with LFS pointer files
(~130 bytes) before executing
- Required explicit double confirmation for each irreversible operation
- Never assumed a general "proceed" covers destructive sub-steps
- Given full control and visibility to the user before any file deletion or history rewriting
Files Affected
Deleted from disk without warning:
- MedioFisicoNatural.gpkg (~890MB, hand-crafted GIS layer)
- LimitesPoliticos.gpkg (~427MB, hand-crafted GIS layer)
Replaced by LFS pointers without warning (working tree broken):
- InfraEstructura.gpkg
- PoligonoEstudio1.gpkg
- Transporte.gpkg
- LimitesPoliticos.gpkg
- MedioFisicoNatural.gpkg
Modified without explicit request:
- .gitignore
- .gitattributes
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Yes, every time with the same prompt
Steps to Reproduce
- Have a git repository with large binary files (.gpkg) exceeding GitHub's 100MB limit
- Ask Claude Code to help manage those files and set up Git LFS
- Claude will execute git filter-repo + git gc without warning that working directory files are deleted
- Claude will execute git lfs migrate import without warning that it replaces working files with pointer files
- Working directory breaks silently
Claude Model
Sonnet
Relevant Conversation
Claude said: "git filter-repo --path file --invert-paths" and then ran
"git gc --prune=now --aggressive" — both without warning that user-created
GIS files would be permanently deleted from disk.
Later Claude said: "git lfs migrate import --include='*.gpkg'" without
warning that this replaces binary files in the working tree with 130-byte
LFS pointer files, breaking QGIS and all dependent workflows.
No double confirmation was requested before either operation.
Impact: → "Critical - Data loss or corrupted project" ✅
Claude Code Version: 2.1.109 (Claude Code)
Platform: → "Anthropic API" (o cámbialo a "Claude.ai" si usas la web)
Impact
Critical - Data loss or corrupted project
Claude Code Version
2.1.109 (Claude Code)
Platform
Anthropic API
Additional Context
This occurred during a long session working on an academic urbanismo project
(UNAM maestría). The files deleted were hand-crafted GIS layers created by
the user — not downloadable datasets — making recovery complex and time-consuming.
Token compensation request: The errors caused significant token waste during
recovery (file reconstruction, debugging broken git states, multiple failed
attempts). Since the data loss was caused directly by Claude's behavior without
adequate user control, token compensation for this session is requested.
Related issue: #62710 (similar pattern — Claude executing destructive git
operations without user confirmation).
Pattern observed: Claude tends to chain destructive operations automatically
in long sessions when given general permission to "proceed", without re-confirming
at each irreversible step.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗