Project path encoding breaks with non-ASCII (Cyrillic) directory names
Description
Claude Code encodes project paths by replacing / with - to create directory names under ~/.claude/projects/. However, non-ASCII characters (e.g. Cyrillic) in directory names are also replaced with -, making the encoding lossy.
Steps to reproduce
- Create a project directory with a non-Latin name, e.g.
~/Documents/Проект - Start a Claude Code session in that directory
- Look at
~/.claude/projects/
Expected behavior
The encoded directory name should uniquely and reversibly represent the original path.
Actual behavior
~/Documents/Проект is encoded as -Users-username-Documents------
Each non-ASCII character is replaced with -, so a 6-letter Cyrillic word becomes 6 dashes. This causes several problems:
- Collisions: Two different project directories with the same number of non-Latin characters (e.g.
~/Проектand~/Привет) produce identical encoded names, potentially merging unrelated project data - Unreadable: The
~/.claude/projects/directory becomes impossible to navigate manually — all non-Latin projects look like sequences of dashes - Non-reversible: The original path cannot be reconstructed from the encoded name
Suggested fix
Use a reversible encoding for non-ASCII characters (e.g. percent-encoding, or keep Unicode characters as-is in directory names) so the original path is always recoverable and unique.
Environment
- Claude Code version: 2.1.96
- OS: macOS (Darwin 25.3.0, arm64)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗