Skip to content

Windows: auto-memory redirect guard fails due to path separators #1

@drewswiredin

Description

@drewswiredin

Bug

isClaudeAutoMemory() in SCRIPTS/lib.mjs (line 127) uses forward-slash matching:

return abs.startsWith(claudeProjects) && abs.includes("/memory/");

On Windows, path.resolve() produces backslash paths (C:\Users\...\memory\...), so abs.includes("/memory/") never matches. The guard silently passes, allowing writes to Claude auto-memory (~/.claude/projects/*/memory/).

Impact

All guards in auto-memory-redirect.mjs are bypassed on Windows — both the write deny and the read redirect.

Likely also affects isMemoryAccess() (line 114) which checks resolve(filePath) === expected — mixed separators could cause mismatches there too.

Fix

Normalize to forward slashes before comparing, e.g.:

const norm = abs.replace(/\/g, "/");
return norm.startsWith(claudeProjects.replace(/\/g, "/")) && norm.includes("/memory/");

Or use path.posix / normalize all paths consistently.

Environment

  • Windows 11 (Git Bash / MINGW64)
  • Lore CLI 0.1.53
  • lore-os bundle (lore-os-services:0.1.53)
  • Node.js 24.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions