[BUG] Project memory silently drops when session cwd differs from user's main project directory
Bug Description
When a Claude Code session starts with a working directory (cwd) different from the user's main project directory, all project-scoped memories are silently dropped — no warning, no fallback, no inheritance from parent directories. This caused a complete loss of 39 out of 40 carefully curated feedback/project/reference memory files, resulting in severe quality degradation.
Root Cause
Project memory is path-scoped under ~/.claude/projects/{slugified-cwd}/memory/. When a session starts from a subdirectory or unrelated directory, it loads a different memory directory that may be empty or nearly empty.
User's main memory: ~/.claude/projects/-Users-prochoi7/memory/ → 40 files (12 feedback corrections, 11 project, 5 reference, 7 user)
Session's loaded memory: ~/.claude/projects/-Users-prochoi7-Downloads-Claude-Cowork/memory/ → 1 file
There is no cascade or inheritance — child/sibling directories don't inherit parent project memories.
Impact
In the affected session (23207c7d), zero feedback correction keywords appeared across the entire 229-message session. The assistant repeated the exact failure patterns that the user had already corrected through months of feedback:
- Made ungrounded conclusions (feedback #1)
- Failed to retract unsupported claims (feedback #3)
- Offered to stop work prematurely (feedback #4)
- Assumed abbreviations without verification (feedback #6)
This is not a minor quality drop — it's a complete loss of behavioral calibration.
Reproduction
- Build up project memories at
~/.claude/projects/-Users-{username}/memory/(home directory scope) - Start a Claude Code session from any other directory (e.g.
~/Downloads/some-folder/) - Observe: none of the home-directory-scoped memories are loaded
- The assistant behaves as if it has never received any feedback corrections
Evidence (JSONL)
Session 23207c7d — started from Claude Desktop with cwd: /Users/prochoi7/Downloads/Claude-Cowork:
{"type":"queue-operation","operation":"enqueue","timestamp":"2026-04-25T16:25:43.240Z",
"sessionId":"23207c7d-b3f5-476c-90af-ce66394ad5df","content":"/이어서"}
{"type":"user","entrypoint":"claude-desktop",
"cwd":"/Users/prochoi7/Downloads/Claude-Cowork", ...}
Keyword search across all 229 lines for core feedback correction identifiers (feedback_no_baseless_conclusion, feedback_no_drop_option, reference_data_mode, feedback_retract_format, feedback_explicit_consent): 0 matches.
Expected Behavior
At minimum:
- Warning: Alert the user when a session loads significantly fewer memories than their most-populated project scope
- Fallback/Cascade: Consider inheriting memories from parent directory scopes (e.g.
~/Downloads/X/inherits from~/) - Global memories: Allow users to mark certain memories as global (loaded regardless of cwd), similar to how
~/.claude/rules/*.mdfiles work
Environment
- Claude Desktop v2.1.119
- macOS (Darwin 25.4.0), MacBook Air M1
- 40 memory files in main project scope, 1 in affected scope
Workaround
The user is implementing a 2-layer defense:
- Promoting critical feedback corrections to
~/.claude/rules/*.md(globally loaded regardless of cwd) - Creating symlinks from secondary project memory directories to the main memory directory
Related
This issue is architecturally similar to the discussion in #42050 (unified sessions/settings across surfaces) — project memory scoping is a surface-level fragmentation issue.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗