-
Notifications
You must be signed in to change notification settings - Fork 603
fix: normalize paths to match Claude Code naming convention #392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Claude Code converts folder paths with special characters (underscores, dots, etc.) to hyphens when creating .claude/projects folders. This fix ensures the mobile app uses the same normalization for consistent session sync. - Add normalizePathForKey utility function - Apply normalization in projectManager, gitStatusSync, and sessionUtils - Add unit tests for path normalization Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…lopus#368)" This reverts commit 1a38983.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes session synchronization failures when folder names contain special characters (underscores, dots, etc.) by implementing path normalization that matches Claude Code's .claude/projects folder naming convention.
Changes:
- Added
normalizePathForKey()utility function to convert paths to Claude Code's naming convention (replacing special characters with hyphens) - Updated session/project key generation in
sessionUtils.ts,projectManager.ts, andgitStatusSync.tsto use normalized paths - Added comprehensive test suite with 214 test cases covering edge cases including Unicode, Windows paths, and special characters
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
sources/utils/normalizePathForKey.ts |
New utility function implementing path normalization logic |
sources/utils/normalizePathForKey.spec.ts |
Comprehensive test suite with extensive edge case coverage |
sources/utils/sessionUtils.ts |
Updated getSessionAvatarId() to use normalized paths |
sources/sync/projectManager.ts |
Updated getProjectKeyString() to use normalized paths |
sources/sync/gitStatusSync.ts |
Updated getProjectKeyForSession() to use normalized paths |
sources/changelog/changelog.json |
Added version 6 entry documenting the fix |
CHANGELOG.md |
Added version 6 entry documenting the fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e023bcf71b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private getProjectKeyString(key: ProjectKey): string { | ||
| return `${key.machineId}:${key.path}`; | ||
| return `${key.machineId}:${normalizePathForKey(key.path)}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid merging distinct projects that normalize to same key
Normalizing the path here makes the project key lossy, so two different directories on the same machine that differ only by characters you replace (e.g., /Users/dev/foo_bar vs /Users/dev/foo.bar, or double-hyphen vs single-hyphen) now collapse to the same key. That causes project grouping, git status sharing, and session management to merge unrelated projects. This is a new behavioral regression introduced by the normalization; if the goal is Claude Code compatibility for sync, you may need a separate normalized key for matching while preserving a lossless key for local project identity.
Useful? React with 👍 / 👎.
…lopus#368)" This reverts commit 54d1aee.
e023bcf to
4060ab8
Compare
Summary
normalizePathForKey()function to normalize paths consistently with Claude Code's.claude/projectsfolder naming conventionTest plan
test_temp_01Fixes #368
🤖 Generated with Claude Code