[BUG] Strange coloring of response text

Resolved 💬 32 comments Opened Jan 27, 2026 by guusholshuijsen-tomtom Closed Apr 19, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

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 provided a response in which they were intending to use YAML and the corresponding color scheme. This resulted in response text where not only the YAML was badly color coded, but also normal text.
I am using Claude Code using Windows 11 Command Prompt. Attached is a screenshot of part of the output.

<img width="683" height="531" alt="Image" src="https://github.com/user-attachments/assets/878616da-1752-4169-961f-5487d867b644" />

What Should Happen?

Normal text should be uncolored, YAML text should be syntax highlighted.

Error Messages/Logs

Helpful response from Claude:
Oh! That's completely unintentional and sounds like a rendering issue with the CLI. I'm not applying any color
  formatting to regular text - I'm just writing plain markdown.

  The sentence "Connection to Your Earlier Work" should appear as a normal heading, not with random word fragments
  colored differently. That sounds like a bug in how Claude Code is rendering my responses in your terminal.

  This could be:
  - A terminal rendering issue
  - A bug in Claude Code's markdown renderer
  - Some interaction with your terminal's color scheme or settings

  Is this happening throughout my responses, or just in certain sections? And more importantly: is it making my
  responses hard to read?

  If it's significantly affecting readability, you might want to report this as an issue at
  https://github.com/anthropics/claude-code/issues with details about:
  - Your terminal type (looks like you're on Windows)
  - What you're seeing vs what you expect
  - Maybe a screenshot if possible

  In the meantime, should I adjust how I write? For example:
  - Avoid headers/formatting that might trigger weird rendering?
  - Keep responses simpler?
  - Or is it readable enough despite the strange coloring?

Steps to Reproduce

I have not attempted to reproduce, because I have no clue how to do that.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.20

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

32 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/17314
  2. https://github.com/anthropics/claude-code/issues/20799
  3. https://github.com/anthropics/claude-code/issues/19677

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Florian-Thake · 5 months ago

Hi,
if the root cause of this is the same as with the wrong syntax highlighting, which I experienced,
then I know a way to fix / workaround this:

Open the Settings of the Windows Terminal and then
switch Text Measurement Mode to wcswidth to fix the issue. (restart of the Terminal required)

Settings -> Compatibility -> Text Measurement Mode -> wcswidth

When setting to the default "Grapheme Clusters" mode, the bug is present.

Claude Code was not aware of this setting, but it gives a good reasoning when the fix is mentioned to it.

The workaround above should also fix #20799 but it does not help for #17892

guusholshuijsen-tomtom · 5 months ago

Hi Florian-Thake, thanks for the suggestion, although it did not work for me.

<img width="393" height="165" alt="Image" src="https://github.com/user-attachments/assets/79ce59dd-b289-4072-b14c-993b98d41dcc" />

Did you try asking Claude for a random piece of YAML code?

guusholshuijsen-tomtom · 5 months ago

I had a conversation with Claude both in Command Prompt and Powershell and the problem occurred in both. Attached the Claude conversation:

<img width="1103" height="1100" alt="Image" src="https://github.com/user-attachments/assets/478494aa-1ace-4229-9e8f-f2e20d753c81" />

mj321 · 5 months ago

Same issue. Setting Text Measurement Mode -> wcswidth didn't fix it.

Florian-Thake · 5 months ago

@guusholshuijsen-tomtom Ah, I see, that is a pity. I don't really get where is the difference in our cases...

Just for reference, I experienced broken json syntax highlighting like in the attached screenshot.

<img width="1616" height="827" alt="Image" src="https://github.com/user-attachments/assets/086b262c-7e09-4371-b0b5-089c73bed4b0" />

This issue could be fixed on my side with Text Measurement Mode -> wcswidth
I was double verified it by switching back and force the settings.

here is one example json file in case somebody want to try it

example1.json

I still have some broken color formatting from time to time but this never happens during syntax highlighting. I guess, the issue I still experience might be this one #17892

Florian-Thake · 5 months ago

Oh, I must provide an update. I most likely ran into a coincidence when I was verifying the issue last time.
Sorry for any confusion regarding this issue.

Now at my side the Terminal was behaving the opposite. With Text Measurement Mode -> wcswidth I could reproduce the bug, as I changed it back to Grapheme Clusters the bug disappeared.
So, the thing which let the bug appear or disappear must be something else.

Ok, after testing I know now what was helping on my side:

  • starting a new claude session: bug is there.
  • resuming a claude session with --resume : the bug is not there.

It even can be in the same Terminal instance.
Can somebody else verify if resuming a claude session has proper syntax highlighting?

gt732 · 5 months ago

This is also happening to me on the latest version of claude code on windows...its driving me insane, what is the fix?

<img width="1109" height="333" alt="Image" src="https://github.com/user-attachments/assets/3ff85f07-004b-4ec3-bf99-d3067406c16d" />

sbrockway · 5 months ago

I'm experiencing this as well. I won't add another screenshot, those above are sufficient.
I am using the native installer on Windows. I had originally used the node package, but migrated to the native.
I have a coworker that is running on Linux (WSL) that does NOT see this behavior.
Maybe its Windows specific or native (not node) specific.

JohannesGESchmidt · 5 months ago

let's call it cow bug:

pwsh on windows 11:
<img width="1112" height="312" alt="Image" src="https://github.com/user-attachments/assets/aead2288-a7c0-4067-84d5-0ad02267690d" />

<img width="275" height="183" alt="Image" src="https://github.com/user-attachments/assets/d1c6f758-3ddc-4ee2-a715-ddb2f744a842" />

psarno · 5 months ago

Same issue both in reasoning traces (verbose mode) as well as responses.

Windows 11 PowerShell latest preview.

<img width="954" height="173" alt="Image" src="https://github.com/user-attachments/assets/ae1d2aed-3ddf-4b50-ad19-7796e2ffdca3" />

byarielm · 5 months ago

<img width="745" height="794" alt="Image" src="https://github.com/user-attachments/assets/a256ce06-acf6-4f04-b010-c3735d6abf85" />
<img width="866" height="789" alt="Image" src="https://github.com/user-attachments/assets/2cad48ed-9d2c-47e1-abb0-aa8dad6a5690" />
<img width="723" height="177" alt="Image" src="https://github.com/user-attachments/assets/7cfe55a3-46be-4e83-8001-e66a94f270a0" />

This behavior is driving me mad. Windows 11, CC 2.1.19, text measurement mode = grapheme clusters.

Things I've tried with no change:

  • terminal with command prompt and powershell
  • cmd.exe
  • git bash
  • terminal in zed.dev
  • switching claude config terminal settings
  • turning off syntax highlighting for user
  • resuming a session still shows the garbled colors
  • resuming a session from a month ago (I don't recall if this is a new issue or a worsening of one)

I've an ubuntu distro on this hard drive too, I don't think the issue is happening there but I use CC less on that system, so will negate this later if I find that's not true.

MegaNeal · 5 months ago

Same issue.

BachNewton · 5 months ago

I have the same issue.

Environment

  • Claude Code version: 2.1.37
  • OS: Windows 11 (build 26200, x86_64)
  • Terminal: Windows Terminal (WT_SESSION active)
  • TERM: xterm-256color
  • Node.js: v24.12.0
  • Shell: Git Bash (MINGW64/Msys)

<img width="827" height="534" alt="Image" src="https://github.com/user-attachments/assets/066c91ab-b64a-4423-9e47-38379287ede6" />

BachNewton · 5 months ago

I found it interesting that if Claude uses echo -e instead, then all the output looks just fine.

<img width="1103" height="705" alt="Image" src="https://github.com/user-attachments/assets/fec3541c-56b2-4d0f-a8f2-cfdb3f21573b" />

<img width="1101" height="907" alt="Image" src="https://github.com/user-attachments/assets/d380ddf0-3e14-4540-bf62-6b880e254fbe" />

ismailyavuznar · 5 months ago

It looks like there is a shift between letters and colorizations of them. So there might be a way to reset to sync letter-printing and colorization at least since its original cause full resolution may take time.

rfmsanz-ethan · 5 months ago

+1

Windows 11 Pro 25H2 26200.7462
Claude Code 2.1.38
Windows Terminal (using PowerShell)

This has been happening for several months for me, so I'm not sure which version caused the regression.

dmitryshapar3 · 5 months ago

Did anyone manage to fix that?

fireapache · 5 months ago

I believe it's not counting CRLF in Powershell, every new line adds 2 character offset. I may clone the repo and try a fix for this, lets see.
<img width="1200" height="373" alt="Image" src="https://github.com/user-attachments/assets/53dc0f65-559a-4a43-b09a-c54029256e29" />

rfmsanz-ethan · 5 months ago

This happens to me when using git bash via Windows Terminal too, not just PowerShell.

fireapache · 5 months ago

Seems like actual Claude Code application source is bundled into a minified cli.js, which pacthing it isn't the best idea.

countzero · 5 months ago

Regarding to https://gist.github.com/frostbtn/f85b574ce132c8853945df852e1e0d31 the bug was introduced with Claude Code 2.1.14 that implies that version 2.1.12 from ~ a month ago is the last officially usable version for Windows.

Workaround

claude install 2.1.12

@bcherny, @ashwin-ant and @fvolcic please take a look at this coloring bug, it renders the app unusable on Windows and there is now a sufficient amount of tickets regarding this issue with deep analysis and sound solution suggestions.

Eternal21 · 5 months ago
Did anyone manage to fix that?

Yes! Point Claude Code at @i-dedova's https://github.com/anthropics/claude-code/issues/17314#issuecomment-3864733114 and ask it to implement the fix. It will patch the binary and set up the SessionStart hook automatically so it survives auto-updates. Works with the native Windows installer - no npm needed.

The crazy colors are finally gone:

<img width="1081" height="684" alt="Image" src="https://github.com/user-attachments/assets/392f74cc-6792-4565-afba-b20223b3fdf6" />

MegaNeal · 4 months ago

Confirming that 2.1.12 works just fine... hoping for a fix soon :(

rfmsanz-ethan · 4 months ago
> Did anyone manage to fix that? Yes! Point Claude Code at @i-dedova's #17314 (comment) and ask it to implement the fix. It will patch the binary and set up the SessionStart hook automatically so it survives auto-updates. Works with the native Windows installer - no npm needed. The crazy colors are finally gone:

This hook worked for me. I am using CC native ARM64 binary. I know the pattern is the same in the other architectures' binaries, but I don't know if there are any differences to take into account. You could start with these and ask Claude to check them and implement them according to your current installation.

OneDrive Folder with Hook

If anyone can get the attention of anthropic devs to implement a fix of the root cause (as identified by @WargameGPT - HERE) that would be super.

calilafollett-rm · 4 months ago

I'm not a fan of patching binaries and definitely not when my team's daily workflow relies on Claude Code for production work. It sure would be nice to get Anthropic to make the proper fixes and get this release. Some of the random-colored text output can be extremely difficult to read.

epikhighs · 4 months ago

FYI. If you stretch out the terminal window to be wide enough, the colors typically correct. It has something to do w/ the new line wraps. So that's a temp workaround for specific outputs if you really need the colors to read a particular prompt response. I really do wish this can be addressed. It's surprising it's been an issue for so long with how rapidly they release new versions. I'm not sure why this isn't like a critical bug for claude code.

jparta · 4 months ago
Eternal21 · 4 months ago

I can confirm the bug was fixed in 2.1.50 on Windows native installation.

mj321 · 4 months ago

Fixed for me, too: Windows, 2.1.73

ashwin-ant collaborator · 2 months ago

This was fixed in v2.1.47 — Fixed bold/colored text shifting to the wrong characters on Windows due to a CRLF line-ending offset bug in the markdown renderer. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

github-actions[bot] · 2 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.