[MODEL] Move version-controlled files with `git mv`, not plain mv
Resolved 💬 3 comments Opened Oct 19, 2025 by alexeyv Closed Jan 10, 2026
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
Other unexpected behavior
What You Asked Claude to Do
move a source file from directory A to directory B
What Claude Actually Did
Uses plain OS move file operation, effectively deletes it in directory B and starting a new file with no history in directory B.
Expected Behavior
use version control system's move operation, preserving history.
Files Affected
commits in .git
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Yes, every time with the same prompt
Steps to Reproduce
- Create a new local git project with directory A containing file foo.sh. Contents of the file don't really matter.
- Ask Claude to create directory B and move foo.sh into it.
- Run
git statusand see that, as far as Git is concerned, foo was not moved. Instead, the old foo.sh was deleted and the new one was created at the new location. All the history of the old foo.sh is gone with it.
Claude Model
Sonnet
Relevant Conversation
Impact
High - Significant unwanted changes
Claude Code Version
v2.0.22
Platform
Anthropic API
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗