pub fn encode_project_path(project_path: &str) -> StringExpand description
Encode a project path the way Claude Code names its ~/.claude/projects/ folders (checked
against Claude Code 2.1.287): every UTF-16 code unit that is not an ASCII letter or digit
becomes -, and a name longer than 200 is cut to 200 and suffixed with - and a base-36
hash of the path.
Windows: S:\Loom -> S--Loom, C:\Users\me\.claude -> C--Users-me--claude
macOS/Linux: /Users/seven/Loom -> -Users-seven-Loom
Trailing separators are dropped first, since a stored S:\Loom\ is the folder Claude Code
runs in as S:\Loom; a bare root (S:\, /) keeps its separator.