[Bug] Claude performs edits that do not match the approved ones, thereby replacing ASCII quotes with Unicode quotes in code generation, breaking syntax

Resolved 💬 2 comments Opened May 13, 2026 by mminot-yseop Closed Jun 16, 2026

Bug Description
Claude often gets confused about quotation marks. Claude breaks code syntax by writing Unicode quotes (“…”, ‘…’) instead of ASCII quotes ("…", '…') in the code it generates or edits.

It often even replaces quotes on existing lines that it was not even supposed to touch and that are unrelated to the current task, sometimes breaking half a file in the process, even for trivial tasks.

To make matters worse, it struggles to fix such mistakes afterward: it consumes thousands of tokens and lots of time, and relies on fragile Python scripts to try to revert quotes (often also reverting “normal” Unicode characters from code comments and hardcoded strings, instead of leaving those as-is).

I added examples in my configuration to try to teach Claude about the differences between those characters, but it is still far from perfect.

This is currently by far my biggest pain-point with Claude Code. I’ve seen this happen primarily in Bash scripts, but also in Groovy files (typically Jenkinsfile pipelines) and Java code. Maybe it’s partly because I write most of my documentation and log lines with Unicode double quotes and apostrophes, but this should not be a problem in languages that perfectly support (or even encourage) Unicode source files and so on.

Edit 2026-05-18: Oftentimes, Claude suggests an edit that looks correct (expected quote style), I approve the edit, and then it edits the file by using the wrong quotes. Therefore, I can’t even prevent this from happening just by looking carefully at its suggestions.

Environment Info

  • Platform: linux
  • Terminal: vte-based
  • Version: 2.1.140
  • Feedback ID: 484dd3bb-251a-40aa-91cd-fd215e451b0d

View original on GitHub ↗

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