Skip to content

Path encoding mismatch for directories with underscores #157

@vivalogic-vivek

Description

@vivalogic-vivek

Bug Description

Happy Coder's path encoding for Claude project directories differs from Claude's own encoding when directory names contain underscores. This causes Happy to fail to find session transcript files, resulting in no message history/updates being synced to the mobile device.

Environment

  • Happy CLI Version: 0.13.0
  • Platform: win32 x64
  • Node.js Version: v20.20.0
  • Claude Code Version: 2.1.31

Steps to Reproduce

  1. Have a working directory with an underscore in the path, e.g., C:\Users\username\Documents\_Dev\project
  2. Start a Happy session: happy
  3. Session registers with server and appears on mobile device
  4. No message history or updates appear on mobile

Root Cause

Path encoding mismatch between Claude and Happy Coder:

Component Encodes _Dev as
Claude --Dev (converts underscore to dash)
Happy Coder -_Dev (preserves the underscore)

Claude stores projects in:

C:\Users\vshim\.claude\projects\C--Users-vshim-Documents--Dev-VivaLogic-CLIP-clip-demos

Happy Coder is looking for:

C:\Users\vshim\.claude\projects\C--Users-vshim-Documents-_Dev-VivaLogic-CLIP-clip-demos

Evidence from Logs

Session log shows repeated file watcher errors:

[FILE_WATCHER] Watch error: ENOENT: no such file or directory, watch 'C:\Users\vshim\.claude\projects\C--Users-vshim-Documents-_Dev-VivaLogic-CLIP-clip-demos\8e96c771-300d-4d5f-9a36-a580fe3f3e48.jsonl', restarting watcher in a second

The directory doesn't exist because Claude encoded the path differently.

Expected Behavior

Happy Coder should use the same path encoding algorithm as Claude Code to correctly locate session transcript files.

Workaround

Creating a symlink from the incorrect path to the correct path:

mklink /D "C:\Users\vshim\.claude\projects\C--Users-vshim-Documents-_Dev-VivaLogic-CLIP-clip-demos" "C:\Users\vshim\.claude\projects\C--Users-vshim-Documents--Dev-VivaLogic-CLIP-clip-demos"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions