Claude Code’s Windows Backslash Bug
This episode breaks down a Windows bug in Claude Code where unescaped backslashes in file paths triggered Unicode parsing errors, causing crashes and garbled folder names. It also covers recent Windows-focused fixes, including safer Git Bash path handling and a PowerShell permission patch, with a reminder to update to the latest release.
Chapter 1
The Backslash Unicode Trap in Claude Code
Lachlan Reed
James, you are not going to believe the bug I was tracing this morning. It is a absolute classic. Picture this, right? A developer named Ursula, she is working on Windows, opens up the new Claude Code CLI tool, and tries to index her project. And boom! Everything breaks. The tool completely loses its mind, files in her user directory are suddenly inaccessible, throwing these bizarre errors, or even worse, rendering her folder names as corrupted Chinese, Japanese, and Korean CJK characters in the console.
James Turner
Wait, CJK characters? From a local file path on Windows? That sounds like some weird AI hallucination or a corrupted workspace, but I bet it is actually something way more mundane under the hood.
Lachlan Reed
Spot on, mate! It is not the AI acting up at all. It is a classic JSON escape character collision, and it was just patched in version 2.1.218. It turns out, Ursula was trying to load a path like C, colon, backslash, Users, backslash, ursula, backslash, project. And that is where the trap snaps shut.
James Turner
Oh! Backslash, Users, backslash, ursula. The backslash followed by the letter u. In programming, backslash u is the prefix for a Unicode escape sequence!
Lachlan Reed
Yes! Exactly! You nailed it. When the tool serialized that path into a JSON payload for the LLM to read, it did not double escape the backslashes. So the JSON parser saw backslash u and thought, oh, beauty, here comes a four digit hexadecimal Unicode character. It grabbed the next four characters, which were r, s, u, and l from her name ursula, tried to parse rsul as hex digits, and either completely choked or spat out total mojibake.
James Turner
That is hilarious and painful. The letter r is definitely not a valid hex character, so no wonder it crashed. And if her username had been, I do not know, something starting with a, b, c, d, e, or f, like uh, Fred, then backslash u, f, r, e, d would actually parse as some random CJK character! That is wild.
Lachlan Reed
It is brilliant, right? So if your name is Fred, you get weird symbols, and if your name is Ursula, you just get a flat out crash. But the good news is, Anthropic fixed this in version 2.1.218. They made sure all Windows backslashes are strictly double escaped, so it becomes C, colon, double backslash, Users, double backslash, ursula, before it ever touches a tool execution payload. So if you are on Windows, you need to run claude update right now to get onto version 2.1.218 or the even newer version 2.1.220 stability release.
James Turner
Right, because otherwise the agent basically cannot touch any files in your user directory. But you know, it feels like Windows always gets the short end of the stick with these CLI developer tools. Have they been fixing other Windows specific stuff lately?
Lachlan Reed
Oh, absolutely, they have been doing some serious hardening. Just in version 2.1.219, they fixed a nasty crash where if your CLAUDE CODE GIT BASH PATH environment variable pointed to an invalid binary, the whole CLI would just die. Now, it gracefully falls back to a safe default path and just gives you a polite warning. And if we look slightly further back to version 2.1.214, they patched a security vulnerability that was bypassing permission checks in PowerShell 5.1. So they are definitely putting in the work to make Windows a first class citizen here.
James Turner
That is actually super reassuring. So, simple moral of the story: if you are developer on Windows, especially if your name starts with a U, go run claude update and save yourself some massive headaches.
Lachlan Reed
Too right, mate. Save Ursula! Anyway, that is all for this quick update. Catch you later.
James Turner
See ya.