[BUG] Project-slug write path drops a repeated path segment; read-key ≠ write-key in one session → silent memory split
What's Wrong?
Project at /Users/destroyo/Projects/companyname/companyname-ios. The correct project slug (every / → -) is -Users-destroyo-Projects-companyname-companyname-ios — companyname legitimately appears twice (parent dir + child dir name). Session transcripts and memory correctly live at ~/.claude/projects/-Users-destroyo-Projects-companyname-companyname-ios/.
But within a single session (v2.1.225) the two derived keys disagree:
- READ: at session start the harness loaded
MEMORY.mdfrom the correct doubled-slug dir (its full content was present in context). - WRITE: the memory-dir path injected into the model's instructions was
-Users-destroyo-Projects-companyname-ios— onecompanyname-segment dropped. Writing memory there silently created a brand-new, empty~/.claude/projects/-Users-destroyo-Projects-companyname-ios/memory/, invisible to every past and future session.
So the same session read memory from key A but wrote it to key B, with no warning. It was only caught because a Write into the "memory dir" produced a directory containing exactly one file.
This is the same umbrella as #76647 (one project → two non-syncing memory dirs) and #70076 (slug encoding collisions), but the trigger here is (a) a dropped repeated path segment and (b) an intra-session mismatch between the read key and the injected write key.
What Should Happen?
A project directory maps to exactly one slug, used identically for both reading and writing memory, with no segment dropping. companyname/companyname-ios must not collapse to companyname-ios.
Steps to Reproduce
- Create a project whose path contains a repeated adjacent segment, e.g.
~/Projects/companyname/companyname-ios(parentcompanyname, childcompanyname-ios). - Open Claude Code there; let it load/read project memory (resolves to the correct doubled slug).
- Have it
Writea memory file to the memory dir named in its instructions. - Observe the file lands in
~/.claude/projects/<slug-with-one-companyname>/memory/— a different directory from where session history and memory are read.
Claude Code Version
2.1.225 (Claude Code)
Platform
macOS (darwin 24.6.0), Anthropic API
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗