Skip to content

fix: resolve Claude Code project folders whose names contain dots or underscores - #367

Closed
Mark Warren (ZeSnarf) wants to merge 1 commit into
microsoft:mainfrom
PharSideLabs:claude/upstream-claude-dir-names
Closed

Mark Warren (ZeSnarf) wants to merge 1 commit into
microsoft:mainfrom
PharSideLabs:claude/upstream-claude-dir-names

Conversation

@ZeSnarf

@ZeSnarf Mark Warren (ZeSnarf) commented Nov 3, 2026 •

Copy link
Copy Markdown

Description

Claude Code names a project folder by turning every character of the working folder's path that isn't an ASCII letter or digit into -. For example, /work/.agents becomes -work--agents and /work/my_app becomes -work-my-app. projectNameFromEncoded matches directory entries against that name, but encodeComponentForMatch only turned whitespace into -. A folder with a dot or an underscore in its name therefore never matched. The workspace name fell back to the encoded tail (-agents), so one folder showed up as two workspaces (-agents from Claude Code, .agents from Codex and Copilot) on the dashboard and on Coding Moments.

This PR:

  • makes encodeComponentForMatch encode every character other than a letter or digit, as Claude Code does;
  • bumps CACHE_VERSION so cached workspace names are parsed again.

We found this by running the extension on real Claude Code logs, where a .agents working folder was split into two workspaces.

Related Issues

None filed.

Checklist

  • npm run check passes (typecheck + lint + spellcheck + knip + tests)
  • Changes are covered by tests (parser-claude.test.ts: folders named .agents and my_app.v2)
  • Documentation updated (if applicable): not needed

…underscores

Claude Code encodes a working folder as its project directory name by
turning every character other than an ASCII letter or digit into '-'.
encodeComponentForMatch only turned whitespace into '-', so a folder such
as '.agents' or 'my_app' never matched its directory entry and the
workspace name fell back to the encoded tail ('-agents'), splitting one
workspace into two in the dashboard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ZeSnarf

Copy link
Copy Markdown
Author

Closing as a duplicate of #270, which makes the same change and was opened first. Sorry for the noise.

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.

1 participant