[Claude-Sonnet-4-6] - Copy file error, never learns correct method in Windows
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 made incorrect assumptions about my project
What You Asked Claude to Do
I created a change to a script file with Claude. Then Claude asked it it could copy file to the new folder it was to be used in.
In Windows - the Copy method fails the first time, every-time, then it copies the known windows method. Likely tries Linux method first.
What Claude Actually Did
Claude tries Linux copy command first every time, even though it is not in Linux.
Expected Behavior
Claude should be aware it is in Windows and use Windows Prompt commands first.
Files Affected
Source and Destination files.
But really it just eats up compute for no reason.
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Yes, every time with the same prompt
Steps to Reproduce
Have Claude create or edit a file in one folder
Tell Claude it will be used in a second (same level) folder.
Claude asks if it can copy - say Yes.
Claude copies with Unix commands, fails ( ⎿ Error: Exit code 127
/usr/bin/bash: line 2: Copy-Item: command not found
/usr/bin/bash: line 3: Copy-Item: command not found)
Claude then correctly copies with correct command
Claude Model
Sonnet
Relevant Conversation
⎿ Error: Exit code 127
/usr/bin/bash: line 2: Copy-Item: command not found
/usr/bin/bash: line 3: Copy-Item: command not found
Impact
Low - Minor inconvenience
Claude Code Version
Claude Code v2.1.133, Sonnet 4.6 · Claude Max
Platform
Anthropic API
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗