claude-code - 💡(How to fix) Fix [Claude-Sonnet-4-6] - Copy file error, never learns correct method in Windows

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

⎿  Error: Exit code 127 /usr/bin/bash: line 2: Copy-Item: command not found /usr/bin/bash: line 3: Copy-Item: command not found

Code Example

Source and Destination files.

But really it just eats up compute for no reason.

---

⎿  Error: Exit code 127
     /usr/bin/bash: line 2: Copy-Item: command not found
     /usr/bin/bash: line 3: Copy-Item: command not found
RAW_BUFFERClick to expand / collapse

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 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING