anthropics / anthropics/claude-code
Memory files become unopenable in file-preview pane after session's working directory changes
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
## Description
The auto-memory system's file-preview links become permanently unopenable within a session once that session's working directory changes away from the directory the session originally started in.
## Steps to reproduce
1. Start a Claude Code session in project directory A. The memory system is initialized at `~/.claude/projects//memory/`.
2. Mid-session, change the working directory to project B (e.g. via `cd` or the app's directory switcher).
3. Ask Claude to reference or open a memory file (e.g. via the `MEMORY.md` index links).
4. Click the memory file link in the file-preview pane.
## Expected
The file opens in the preview pane, since the absolute path is valid and the file exists.
## Actual
The preview pane shows "Couldn't find this file — It may have been deleted, or it lives outside the working directory," and prints the correct absolute path to the file (which does exist on disk). The pane appears to restrict previews to the current working directory's tree, but the memory system itself remains pinned to the original directory's `~/.claude/projects//memory/` for the lifetime of the session — so this becomes permanently unreachable via the UI for that session once the working directory diverges, even though memory is documented as persisting "across conversations."
## Impact
Any long-running session that changes its working directory loses the ability to preview its own memory files in-app (Finder/external open still works).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue with a session that switches from project A to project B, then trace the memory system's session-pinned directory and the file-preview pane's working-directory validation. Done means links to existing memory files remain previewable after the working directory changes, while normal outside-tree restrictions still behave as intended.
Written by the indexing model from the issue text.
Assessment
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100