BUG: auto-memory system prompt capitalizes first letter of Linux username in path

Resolved 💬 3 comments Opened Feb 23, 2026 by klauskaan Closed Mar 23, 2026

Description

The auto-memory system prompt injects the memory directory path with the first letter of the username capitalized, but the actual filesystem path uses a lowercase first letter. On a case-sensitive Linux filesystem this causes all path-based operations on the memory file to silently fail.

Environment

  • OS: Linux (Debian/Ubuntu based, kernel 6.12)
  • Shell: bash
  • Username: \Klaus\ — all lowercase

Evidence

Actual \HOME\ path (from \printenv HOME | od -An -tx1\):

\\\
2f 68 6f 6d 65 2f 6b 6c 61 75 73
/ h o m e / k l a u s
^^
0x6b = lowercase k
\
\\

System prompt injects the memory directory as:

\\\
/home/Klaus/.claude/projects/-home-Klaus-Source-C-AL-Language/memory/
^^^^
0x4b = uppercase K (WRONG)
\
\\

The username starts with \0x6b\ (lowercase k, ASCII 107). The system prompt uses \0x4b\ (uppercase K, ASCII 75). These are different bytes, and on a case-sensitive Linux filesystem they refer to different paths.

Impact

  • \Read\ and \Write\ tools fail silently when given the injected memory path
  • \git -C <injected-path>\ fails with "No such file or directory"
  • Agent instructions that copy the path from the system prompt all inherit the wrong case
  • The memory file cannot be updated during a session, defeating the purpose of auto-memory

Workaround

Use \find ~/.claude/projects -name "MEMORY.md"\ to locate the actual memory file at runtime instead of relying on the injected path.

Reproduction

Any Linux user whose username begins with a lowercase letter that Claude Code capitalizes in the injected memory path. Confirmed with username \Klaus\ (all lowercase).

Notes

The project directory slug in the path (\-home-Klaus-Source-C-AL-Language\) correctly uses the lowercase username. Only the leading \/home/\ segment gets the wrong case. This suggests the capitalization happens specifically when constructing the \/home/<username>\ prefix of the path.

Related: #2329 (incorrect memory path in selection menu), #8625 (path case mismatch on Windows) — but this is a distinct Linux-specific issue.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗