[BUG] Non-ASCII project path encoding causes memory directory collisions for CJK users

Resolved 💬 2 comments Opened Apr 10, 2026 by TonyPositive Closed May 22, 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?

Claude Code encodes project paths by replacing all non-ASCII characters with - when creating the ~/.claude/projects/ directory structure.

For CJK users, this causes real directory collisions. Example — three different project folders:

D:\Projects\大明科技\
D:\Projects\大華實業\
D:\Projects\天成企業\

All become the same memory path:

~/.claude/projects/D--Projects-----/memory/

Because all three company names are 4 Chinese characters → ----. The directories are identical, and Claude mixes up memories between completely different projects.

In my case, confidential data (credentials, network configs) from Project A leaked into Project B's memory. I had to manually audit and clean every memory file.

Taiwan alone has over 1.6 million registered companies, most with 2–4 character names. This is not a theoretical risk — collisions happen constantly in real CJK workflows.

What Should Happen?

Claude Code encodes project paths by replacing all non-ASCII characters with - when creating the ~/.claude/projects/ directory structure.

For CJK users, this causes real directory collisions. Example — three different project folders:

D:\Projects\大明科技\
D:\Projects\大華實業\
D:\Projects\天成企業\

All become the same memory path:

~/.claude/projects/D--Projects-----/memory/

Because all three company names are 4 Chinese characters → ----. The directories are identical, and Claude mixes up memories between completely different projects.

In my case, confidential data (credentials, network configs) from Project A leaked into Project B's memory. I had to manually audit and clean every memory file.

Taiwan alone has over 1.6 million registered companies, most with 2–4 character names. This is not a theoretical risk — collisions happen constantly in real CJK workflows.

Error Messages/Logs

No error messages — Claude silently uses the wrong memory directory without any warning.

Steps to Reproduce

1. On Windows (or any OS), create two project folders with different CJK names of the same character count, e.g.:
   - D:\Projects\大明科技\
   - D:\Projects\大華實業\
2. Run `claude` in the first folder, let it save some memories
3. Run `claude` in the second folder
4. Check ~/.claude/projects/ — both folders map to the same directory
5. Memories from the first project appear in the second project's context

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.98 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

This was previously reported in #19972 but was auto-closed by a bot due to inactivity before being addressed. The underlying bug still exists.

The current dash-replacement approach is fundamentally broken for any non-ASCII locale. Even if two paths have different CJK characters, as long as the character count and ASCII prefix match, they collide. This is a data isolation / security concern, not just a cosmetic issue.

View original on GitHub ↗

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