anthropics / anthropics/claude-code

[BUG] On Windows, CLaude Code always like to use `python - << 'EOF'` to edit files.

Open
#95,672 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:model area:tools bug platform:windows
Dominant language
TypeScript
Stars
147k
Forks
24k
PR merge metrics
PR metrics pending

Description

Preflight Checklist
  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code
What's Wrong?

I've noticed that on Windows, Claude always seems to prefer using Bash tools to read and edit files, but errors occur almost every time. After an error occurs, it self-corrects by using the "Read" and "Edit" tools to complete the task, and then it's able to edit the file correctly. Isn't this a major problem?

What Should Happen?

Claude Code should use the built-in tools to read and edit files.

Error Messages/Logs
Bash(cd "D:/xxx/xqt_lib" && python - << 'EOF'
xxx
'''
path.write_text(src, encoding='utf-8', newline='\n')
EOF
git diff --stat; git ls-files --eol xqt_style/xqt_style_toolbutton.py)
	Error: Exit code 2
	/usr/bin/bash: -c: line 189: unexpected EOF while looking for matching `''
Steps to Reproduce
  1. fix xxx
Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

v2.1.278

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Windows PowerShell case using the reported Bash command with the Python heredoc and confirm the unexpected EOF error. Trace the command/tool-selection path involved in choosing Bash for file edits; done means Windows file reads and edits reliably use the built-in tools without the reported shell failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, powershell, python, typescript
Domain
cli, operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.