claude-code - 💡(How to fix) Fix [Bug] Claude replaces ASCII quotes with Unicode quotes in code generation, breaking syntax [1 participants]

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…
GitHub stats
anthropics/claude-code#58717Fetched 2026-05-14 03:41:17
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Root Cause

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.

RAW_BUFFERClick to expand / collapse

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.

Environment Info

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

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

claude-code - 💡(How to fix) Fix [Bug] Claude replaces ASCII quotes with Unicode quotes in code generation, breaking syntax [1 participants]