Skip to content

fix: match Claude Code's project key encoding for special characters#14

Closed
tenishevnikita wants to merge 1 commit intovakovalskii:mainfrom
tenishevnikita:fix/project-key-encoding
Closed

fix: match Claude Code's project key encoding for special characters#14
tenishevnikita wants to merge 1 commit intovakovalskii:mainfrom
tenishevnikita:fix/project-key-encoding

Conversation

@tenishevnikita
Copy link
Copy Markdown

Summary

  • Bug: Session detail files were not found for projects with underscores (or other special characters) in their paths, showing "No detail file available for this session" in the UI.
  • Root cause: Claude Code encodes project paths by replacing all non-alphanumeric characters (except -) with - (e.g. personal_projectspersonal-projects). CodeDash only replaced / and ., leaving _ and other special chars intact, so the computed key didn't match the actual directory name.
  • Fix: Changed regex from /[\/\.]/g to /[^a-zA-Z0-9-]/g in all 4 places where project keys are computed (loadSessions, deleteSession, exportSessionMarkdown, findSessionFile).

Example

Path Before (broken) After (correct)
/home/user/personal_projects -home-user-personal_projects -home-user-personal-projects
/home/user/hackathon_april -home-user-hackathon_april -home-user-hackathon-april

Test plan

  • Verified locally: 122 sessions with _ in path now correctly resolve detail files (was 0 before fix)
  • Sessions without special chars continue to work as before
  • codedash list and web UI both show correct data

…cial chars

Claude Code encodes project directory paths by replacing ALL non-alphanumeric
characters (except hyphens) with '-'. CodeDash was only replacing '/' and '.',
leaving underscores and other special characters as-is. This caused session
detail files to not be found for any project path containing underscores
(e.g. personal_projects → expected -personal-projects but searched -personal_projects).

Changed regex from /[\/\.]/g to /[^a-zA-Z0-9-]/g in 4 locations:
- loadSessions() enrichment
- deleteSession()
- exportSessionMarkdown()
- findSessionFile()
vakovalskii added a commit that referenced this pull request Apr 6, 2026
Merged PRs:
- PR #14 (@tenishevnikita): Fix project key encoding — use /[^a-zA-Z0-9-]/g
  to match Claude Code's encoding (fixes paths with underscores). Closes #16.
- PR #19 (@dimstunt): cmux proper Resume (new-workspace) and Focus
  (CMUX_WORKSPACE_ID env var) support.

Windows fixes (#15):
- Skip ps/grep process scanning on win32 (no ps aux on Windows)
- Add stdio:pipe to lsof calls to suppress error output
- Prevents mojibake error spam in PowerShell

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vakovalskii
Copy link
Copy Markdown
Owner

Merged manually in v6.3.3. Applied the regex fix to all 5 locations. Thanks @tenishevnikita!

@vakovalskii vakovalskii closed this Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants