[BUG] Project-slug write path drops a repeated path segment; read-key ≠ write-key in one session → silent memory split

Status Closed — not planned
Reported on v2.1.225
Maintainer reply None cached
Activity 2 comments · opened Aug 13, 2026 · closed Aug 22, 2026

What's Wrong?

Project at /Users/destroyo/Projects/companyname/companyname-ios. The correct project slug (every /-) is -Users-destroyo-Projects-companyname-companyname-ioscompanyname 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.md from 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 — one companyname- 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

  1. Create a project whose path contains a repeated adjacent segment, e.g. ~/Projects/companyname/companyname-ios (parent companyname, child companyname-ios).
  2. Open Claude Code there; let it load/read project memory (resolves to the correct doubled slug).
  3. Have it Write a memory file to the memory dir named in its instructions.
  4. 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

View original on GitHub ↗

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