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 •
Error signatures: MEMORY.md injected twice | case-insensitive filesystem
Symptoms
- Every new session costs noticeably more tokens than expected.
- You see
MEMORY.mdcontent 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.mdmemory.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
1) Move the workspace to a case-sensitive filesystem (recommended)
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.mdand rely onmemory/YYYY-MM-DD.md, or - keep
MEMORY.mdextremely small (so double-injection does not double a large token payload).
Verify
- Start a fresh session and confirm the bootstrap includes
MEMORY.mdonly once. - Token usage drops back to expected levels for short prompts (relative to the doubled baseline).
Related
- OpenClaw docs: Agent workspace
- OpenClaw docs: Memory
- GitHub: #43931