[BUG] Memory keyed to physical path (pwd -P) breaks symlink-based project continuity

Open 💬 0 comments Opened Jun 28, 2026 by sthagen

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When a project folder is renamed and a symlink is created from the old name to the new one, prior session memories are not found when navigating via the symlink.

Root cause: The harness appears to resolve the working directory to its physical path (pwd -P) before deriving the memory storage key. This means cd old-name (where old-name → new-name is a symlink) resolves to new-name as the key, so memories stored under old-name are not found.

What Should Happen?

Expected behavior: The logical path (pwd, without -P) should be used, so that a symlink preserves memory continuity across folder renames — consistent with standard Unix $PWD semantics.

Error Messages/Logs

Steps to Reproduce

Repro steps:

  1. Work in a project folder, accumulate session memories.
  2. Rename the folder (e.g. rug → alusta).
  3. Create a symlink: ln -s alusta rug.
  4. Start a new Claude Code session by navigating into rug (the symlink).
  5. Observe that prior memories are not found — the session starts cold.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.181 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Workaround: Manually copy memory files from the old project key directory to the new one under ~/.claude/projects/.

View original on GitHub ↗