[BUG] \u in Windows path is interpreted as Unicode escape sequence, corrupting file paths for usernames starting with u followed by hex digits

Resolved 💬 4 comments Opened Apr 29, 2026 by mcarbonneaux Closed Jun 11, 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?

Description

On Windows, when a username contains a sequence that looks like a Unicode escape (e.g. uabcdef), Claude Code corrupts the path in all file-related tool calls (Read, Write, Edit, Bash, Glob, Grep).

The backslash-u combination in C:\Users\uabcdef is silently interpreted as a Unicode escape sequence, producing a corrupted character in place of \ua — a path that does not exist.

Workaround

Building the path via a PowerShell intermediate variable avoids the issue:

$u = "uabcdef"
$dest = "C:\Users\$u\path\to\file.txt"
[System.IO.File]::WriteAllText($dest, $content, [System.Text.Encoding]::UTF8)

POSIX-style paths in Bash (/c/Users/uabcdef/...) also work, but break when the file content contains single quotes (heredoc parsing issue).

Impact

Any Windows user whose username matches the pattern u[0-9a-fA-F]{4,} (common in corporate environments where usernames are employee IDs) is affected. All file tool calls silently target a non-existent path.

What Should Happen?

Expected behavior

The path C:\Users\uabcdef\file.txt should be passed as-is to the OS without any Unicode escape interpretation.

Actual behavior

C:\Users\uabcdef\file.txt is silently rewritten to a path containing a spurious Unicode character (e.g. U+0300 range), causing all file operations to fail with EPERM or File not found.

Steps to Reproduce

  1. Run Claude Code on Windows with a username that starts with u followed by 4–6 hexadecimal digits (e.g. uabcdef, u1a2b3c).
  2. Ask Claude to read, write, or edit any file under the user home directory.
  3. Observe that the tool call uses a corrupted path such as C:\Users[corrupted]bcdef\... instead of C:\Users\uabcdef\....

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

na

Claude Code Version

2.1.121 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Environment
  • OS: Windows 11 Enterprise 10.0.22631
  • Shell: Bash (Git Bash / MSYS2) — PowerShell also available
  • Claude Code version: latest CLI
  • Username pattern affected: any username matching u[0-9a-fA-F]{4,} (e.g. uabcdef)

View original on GitHub ↗

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