[BUG] EOF error with qutoes

Resolved 💬 2 comments Opened Mar 6, 2026 by fritz99-lang Closed Mar 6, 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?

Claude keeps running into issues with quotes when dealing with Folder names with spaces in them. This error is new, never was a problem before.

What Should Happen?

I should be able to have file folder names with spaces without throwing an error.

Error Messages/Logs

● Bash(cat > /tmp/write_calc100.py << 'ENDPY'
      script = r'''"""Calculate.…)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 2: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 2: unexpected EOF while looking for matching `''

● The heredoc keeps failing with the escaping. Let me write it as a Python file directly:

Different project

● Write(docs\USER_MANUAL.md)
  ⎿  Error: EEXIST: file already exists, mkdir 'C:\Users\tritl\OneDrive\Nate\The Balance of Power\docs'

● Bash(cd "C:\Users..." && python -c "
      import pathlib…)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 129: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 129: unexpected EOF while looking for matching `''

● The single quotes in the content are breaking the heredoc. Let me use a Python script file instead.

● Bash(cd "C:\Users..." && python -c "
      import pathlib, textwrap…)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 4: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 4: unexpected EOF while looking for matching `''

● The Python inline string has quotes conflicting. Let me use a script file approach.

● Bash(cd "C:\Users..." && python -c "
      import pathlib, sys…)
  ⎿  Written 0 chars

● Let me use a different approach — write a temp Python script.

● Bash(cd "C:\Users\..." && cat > /tmp/write_manual.py << 'PYEOF'
      import pathlib…)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 116: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 116: unexpected EOF while looking for matching `''

● The apostrophe in "..." is breaking the heredoc. Let me use a different delimiter.

Steps to Reproduce

Try writing to a file located inside of a folder with a space in the folder name.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.69

Claude Code Version

2.1.70

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Fairly debilitating as far as work flow goes. A lot of time spent fixing this error.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗