Symptom
Windows users running mm init don't get Claude Code / Codex memory directories auto-detected by the wizard's "Provider memory folders" step. Any such path they add manually is classified under the generic user category instead of claude-memory / claude-plans / codex, so the preset namespace rules added in #312 (claude:{ancestor:1}, claude-plans, codex) don't get applied either.
Silent failure: no error, no warning — the wizard just doesn't find the directories it would find on macOS/Linux.
Root cause
categorize_memory_dir at packages/memtomem/src/memtomem/config.py:1040-1064 uses regex patterns that match forward slashes only:
_PROVIDER_CATEGORY_PATTERNS = (
("claude-memory", re.compile(r"/\.claude/projects/[^/]+/memory/?$")),
("claude-plans", re.compile(r"/\.claude/plans/?$")),
("codex", re.compile(r"/\.codex/memories/?$")),
)
On Windows, str(Path(...)) returns backslash-separated paths (C:\Users\foo\.claude\projects\bar\memory), so none of the patterns match and the function falls through to return "user" (line 1064). The docstring at lines 1056-1058 already acknowledges this gap:
Uses forward-slash regex, so on Windows a backslash-normalised path will fall through to "user" until a future path-sep-agnostic pass lands.
This issue is that "future pass".
Scope
Testing notes
CI (.github/workflows/ci.yml) runs on ubuntu-latest only — no Windows runner. A fix therefore needs platform-agnostic tests that exercise the backslash code path without a Windows host.
Preferred fixture pattern: hand-constructed backslash strings passed directly to categorize_memory_dir, e.g.
assert categorize_memory_dir(r"C:\Users\foo\.claude\projects\abc\memory") == "claude-memory"
Raw strings (r"...") avoid backslash-escape confusion. This exercises the matching logic directly without touching platform-specific path objects. pathlib.PureWindowsPath also works if a fixture prefers path objects, but the raw-string form is the simpler default.
Acceptance criteria
Related
Symptom
Windows users running
mm initdon't get Claude Code / Codex memory directories auto-detected by the wizard's "Provider memory folders" step. Any such path they add manually is classified under the genericusercategory instead ofclaude-memory/claude-plans/codex, so the preset namespace rules added in #312 (claude:{ancestor:1},claude-plans,codex) don't get applied either.Silent failure: no error, no warning — the wizard just doesn't find the directories it would find on macOS/Linux.
Root cause
categorize_memory_diratpackages/memtomem/src/memtomem/config.py:1040-1064uses regex patterns that match forward slashes only:On Windows,
str(Path(...))returns backslash-separated paths (C:\Users\foo\.claude\projects\bar\memory), so none of the patterns match and the function falls through toreturn "user"(line 1064). The docstring at lines 1056-1058 already acknowledges this gap:This issue is that "future pass".
Scope
Path(path).as_posix()orstr(path).replace("\\", "/"))._VALID_PROVIDER_CATEGORIES) stays untouched — this fix does not modify the locked set.Testing notes
CI (
.github/workflows/ci.yml) runs onubuntu-latestonly — no Windows runner. A fix therefore needs platform-agnostic tests that exercise the backslash code path without a Windows host.Preferred fixture pattern: hand-constructed backslash strings passed directly to
categorize_memory_dir, e.g.Raw strings (
r"...") avoid backslash-escape confusion. This exercises the matching logic directly without touching platform-specific path objects.pathlib.PureWindowsPathalso works if a fixture prefers path objects, but the raw-string form is the simpler default.Acceptance criteria
C:\Users\…\.claude\projects\<id>\memory,…\.claude\plans,…\.codex\memories) classify into the correct provider category.TestCategorizeMemoryDir/TestDetectProviderDirsRoundtrip.userfallback, using raw-string backslash fixtures (orPureWindowsPath) so they run on Linux CI.config.py:1056-1058updated to reflect that the gap is closed.C:\Users\foo/.claude/plans) and UNC paths (\\server\share\...) — may be out of scope; contributor's call with rationale in the PR body.Related