Skip to content

fix(discovery): resolve hyphenated project dirs from Claude encoding - #27

Open
MrBeldum wants to merge 2 commits into
loop-eng:mainfrom
MrBeldum:fix/5-decode-hyphenated-project-dirs
Open

fix(discovery): resolve hyphenated project dirs from Claude encoding#27
MrBeldum wants to merge 2 commits into
loop-eng:mainfrom
MrBeldum:fix/5-decode-hyphenated-project-dirs

Conversation

@MrBeldum

Copy link
Copy Markdown

Summary

decodeProjectDir replaced every - with /, so a Claude Code path for /Users/rfirke/my-project decoded as /Users/rfirke/my/project.

Keep the naive decode as a display fallback, but when the encoded path can be resolved on disk, prefer the longest existing directory prefix at each segment so literal hyphens survive.

Fixes #5

Test plan

  • go test ./internal/discovery/ -count=1
  • Existing naive cases unchanged when paths are absent
  • Temp-dir case with my-project resolves correctly

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.

Discovery decodeProjectDir corrupts hyphenated paths

1 participant