fix: decode dots and dashes in encoded project paths#14
Open
alex-reilly-dd wants to merge 2 commits intovtemian:mainfrom
Open
fix: decode dots and dashes in encoded project paths#14alex-reilly-dd wants to merge 2 commits intovtemian:mainfrom
alex-reilly-dd wants to merge 2 commits intovtemian:mainfrom
Conversation
Claude Code encodes folder paths by replacing '/', '.', and literal '-' all as '-', making the encoding lossy. The previous decoder assumed '--' meant a literal dash and single '-' meant '/', which incorrectly turned dotted usernames like 'alex.reilly' into 'alex/reilly'. Replace the decoder with a filesystem-aware greedy algorithm that splits on every '-' and checks candidate path prefixes against the filesystem to resolve whether each dash represents '/', '.', or a literal '-'. Also handles hidden directories (e.g., .claude) and fixes the encoder to replace dots with dashes to match Claude Code's actual behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/claude_notes/cli.py">
<violation number="1" location="src/claude_notes/cli.py:101">
P2: Decoder discards empty fragments from consecutive dashes, so paths containing literal "--" (e.g., "foo--bar") cannot be reconstructed even if they exist on disk.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
When two dashes appear consecutively ('--') in an encoded path, also try
the literal '-' interpretation (e.g., 'foo--bar' → 'foo-bar') in addition
to the '/.' interpretation for hidden directories. Without this, paths
containing literal dashes like 'memory-daemon' could not be reconstructed
when preceded by another encoded separator.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
alex.reilly) into path separators (alex/reilly)-characters by checking candidate paths against the filesystem.claude), literal dashes (memory-daemon), and dotted names correctly.with-to match Claude Code's actual encoding behaviorProblem
Claude Code encodes folder paths by replacing
/,., and keeping literal-all as-. The old decoder assumed--was a literal dash and-was always/, which broke paths containing dots (e.g., usernames likealex.reilly→alex/reilly).Test plan
uv run claude-notes list-projectsshows correct paths with dots, hidden dirs, and literal dashesuv run claude-notes show ~ --format htmlworks correctly with the new encodingmake testpassesuv run ruff checkpasses🤖 Generated with Claude Code
Summary by cubic
Fix decoding of Claude Code–encoded project paths so dotted names, hidden dirs, and literal dashes (including consecutive “--”) resolve correctly. Replaces the decoder with a filesystem-aware greedy algorithm and updates the encoder to replace '.' with '-' for consistency.
Written for commit 3616860. Summary will update on new commits.