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

Status Open
Maintainer reply None cached
Activity 0 comments · opened Sep 20, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] 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_

View original on GitHub ↗