pub fn encode_project_path(project_path: &str) -> StringExpand description
Encode a project path the same way Claude Code does.
Windows: S:\Loom -> S--Loom, C:\Users\Seven\foo -> C--Users-Seven-foo
macOS/Linux: /Users/seven/Loom -> -Users-seven-Loom, /home/alice/proj -> -home-alice-proj
The transform collapses any leading path separator(s) into a single leading
dash, which is how Claude Code writes ~/.claude/projects/ directory names
on Unix. Verified against ccusage’s decoder (see GitHub issue
anthropics/claude-code#19972 for the path-encoding discussion).