Summary
On Windows with WSL2 where the workspace is mounted from a Windows NTFS path (e.g. D:\openclaw), the filesystem is case-insensitive. OpenClaw hardcodes two bootstrap patterns for memory:
pattern: "MEMORY.md"
pattern: "memory.md"
And in memory path resolution:
const memoryPaths = [path.join(workspaceDir, "MEMORY.md"), path.join(workspaceDir, "memory.md")];
On NTFS, both paths resolve to the same physical file, so it gets injected into the system prompt twice — doubling the token cost for every session.
Environment
- OS: Windows 11 + WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2)
- Workspace: Windows NTFS path bind-mounted into Docker container
- OpenClaw version: 2026.3.8 (3caab92)
Steps to Reproduce
- Deploy OpenClaw on Windows with workspace on a Windows NTFS path
- Create a
MEMORY.md file in the workspace
- Observe
MEMORY.md content appears twice in the system prompt bootstrap section
Expected Behavior
MEMORY.md injected once per session.
Actual Behavior
MEMORY.md injected twice (NTFS treats MEMORY.md and memory.md as the same file).
Impact
- ~13K extra tokens injected per session (doubles MEMORY.md bootstrap cost)
- Higher cacheWrite costs on every cold start / compaction
Suggested Fix
Deduplicate bootstrap file paths by real path before injection:
const seen = new Set();
const deduped = files.filter(f => {
try {
const real = fs.realpathSync(f.path);
if (seen.has(real)) return false;
seen.add(real);
return true;
} catch { return true; }
});
Workaround
None via openclaw.json. Moving workspace to a Linux native filesystem (Docker named volume or WSL2 native path) resolves the issue.
Summary
On Windows with WSL2 where the workspace is mounted from a Windows NTFS path (e.g.
D:\openclaw), the filesystem is case-insensitive. OpenClaw hardcodes two bootstrap patterns for memory:And in memory path resolution:
On NTFS, both paths resolve to the same physical file, so it gets injected into the system prompt twice — doubling the token cost for every session.
Environment
Steps to Reproduce
MEMORY.mdfile in the workspaceMEMORY.mdcontent appears twice in the system prompt bootstrap sectionExpected Behavior
MEMORY.mdinjected once per session.Actual Behavior
MEMORY.mdinjected twice (NTFS treatsMEMORY.mdandmemory.mdas the same file).Impact
Suggested Fix
Deduplicate bootstrap file paths by real path before injection:
Workaround
None via
openclaw.json. Moving workspace to a Linux native filesystem (Docker named volume or WSL2 native path) resolves the issue.