Repository navigation
Conversation
… uses forward slashes Config detection looked up the workspace in ~/.claude.json's `projects` with `projects[root]`, where `root` comes from realpath (C:\Users\me\app). Claude Code on Windows writes project keys with forward slashes (C:/Users/me/app), older versions with backslashes, so the lookup missed every project written the newer way and its MCP servers were never offered for import. findClaudeProjectEntries compares keys as Windows paths on win32 (either separator, any case, optional trailing slash) and returns every matching entry, the exact key first, so a project keyed both ways yields both. Other platforms keep the exact-key lookup.
XinQijj
force-pushed
the
fix/claude-json-windows-project-keys
branch
from
December 2, 2026 14:19
17cb3ef to
f6c021e
Compare
This branch has not been deployed
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
On Windows, "detect configs" never finds the MCP servers a project has in
~/.claude.json, unless that project's key happens to use backslashes.hub.tslooks the workspace up withprojects[root], androotcomes fromrealpath:C:\Users\me\app. Claude Code on Windows writes project keys with forward slashes (C:/Users/me/app); older versions used backslashes. On the machine I tested on, 5 of the 8 project keys in~/.claude.jsonuse forward slashes, so those projects' servers were never offered for import.Before / after. I ran the real
detectConfigswith a temporary home folder whose~/.claude.jsonhas one project with one server, keyed with each kind of separator:~/.claude.jsonmainC:\Users\…\proj["projtool"]["projtool"]C:/Users/…/proj[]["projtool"]Change. A new helper,
findClaudeProjectEntries(projects, root, platform)inconfigParser.ts:win32: compares keys as Windows paths: either separator, any case, with or without a trailing slash. It returns every matching entry with the exact key first, so a project keyed both ways (for example, after a Claude Code upgrade) yields both. The hub already removes duplicate server names.hub.tsloops over the entries instead of readingprojects[root].Test. The new case in
configParser.test.tspasses the platform explicitly, so the Windows comparison runs on all three CI systems. It covers forward slashes, a different case, trailing separators, a project keyed both ways, a different folder, and exact-only matching on Linux.Checklist
npm run typecheckpassesnpm testpasses: 878 passed and 2 skipped on Windows 11. One test failed,proxyTransport.test.ts"connects to an IPv6 SOCKS proxy with a bare socket hostname"; it fails the same way onmainbecause the test machine refuses IPv6 loopback connections.npm run buildpasses.