solution gateway medium windows

Windows (NTFS/WSL2): MEMORY.md is injected twice (case-insensitive filesystem)

Fix doubled bootstrap token cost when `MEMORY.md` and `memory.md` resolve to the same file on a case-insensitive NTFS workspace mount.

By CoClaw Team •

Symptoms

  • Every new session costs noticeably more tokens than expected.
  • You see MEMORY.md content appear twice in the injected bootstrap context.
  • This happens on Windows when the workspace is on NTFS (often via WSL2 / Docker bind mounts).

Cause

Some OpenClaw bootstrap logic may probe both of these paths:

  • MEMORY.md
  • memory.md

On a case-insensitive filesystem (NTFS), those can resolve to the same physical file. If the runtime does not deduplicate by real path before injection, the content can be injected twice.

Fix

Choose one:

  • a native WSL2 ext4 path (inside the Linux filesystem), or
  • a Docker named volume (not a Windows bind mount).

This keeps MEMORY.md and memory.md unambiguous.

2) If you must stay on NTFS, reduce the blast radius

If you cannot move the workspace yet:

  • delete MEMORY.md and rely on memory/YYYY-MM-DD.md, or
  • keep MEMORY.md extremely small (so double-injection does not double a large token payload).

Verify

  • Start a fresh session and confirm the bootstrap includes MEMORY.md only once.
  • Token usage drops back to expected levels for short prompts (relative to the doubled baseline).

Verification & references

  • Reviewed by:CoClaw Code Team
  • Last reviewed:March 14, 2026
  • Verified on: Windows
Want to explore more? Browse all solutions or ask in the Community Forum .
Report a problem

Related Resources

Windows (WSL2): gateway service install fails (systemd not enabled)
Fix
Fix WSL2 gateway daemon install issues by enabling systemd in /etc/wsl.conf, shutting down WSL, and retrying openclaw gateway install.
OpenClaw OOM crash loop: gateway or openclaw-message hits JavaScript heap out of memory (Node v24)
Fix
Fix OpenClaw gateway or openclaw-message OOM crash loops caused by Node.js v24 by pinning the runtime to Node v22 (LTS) and verifying your service actually uses the expected Node binary.
Windows native: node run hangs after printing PATH, or the runtime stays unstable
Fix
Stabilize native Windows setups where `openclaw node run` hangs after PATH output, the runtime behaves differently from your shell, or your real requirement is better served by WSL2.
Windows: installer fails and PowerShell closes before you can read the error
Fix
Recover from Windows install/bootstrap failures where the one-liner closes PowerShell too quickly by switching to a readable manual install path and validating Node/npm first.
OpenClaw on Windows: Native vs WSL2, Install Paths, and When to Switch
Guide
A practical decision guide for Windows users: choose between native Windows and WSL2 based on service model, tool compatibility, and debugging cost, then switch paths cleanly when the platform is the problem.
OpenClaw State, Workspace, and Memory: Persistence & Permissions Troubleshooting
Guide
Fix OpenClaw persistence the boring way: confirm the real state and workspace paths, repair write permissions, verify artifacts survive restarts, and stop confusing runtime drift with memory loss.