claude-code - 💡(How to fix) Fix /memory command fails to resolve symlinked user memory file in WSL

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When ~/.claude/CLAUDE.md is a symbolic link (a common setup for managing Claude Code settings in a separate git repository), the /memory command passes the symlink path directly to the editor instead of resolving it to the real file path.

As a result, VS Code opens ~/.claude/CLAUDE.md as an empty file, making it impossible to view or edit the actual content through the /memory command.

Root Cause

When ~/.claude/CLAUDE.md is a symbolic link (a common setup for managing Claude Code settings in a separate git repository), the /memory command passes the symlink path directly to the editor instead of resolving it to the real file path.

As a result, VS Code opens ~/.claude/CLAUDE.md as an empty file, making it impossible to view or edit the actual content through the /memory command.

RAW_BUFFERClick to expand / collapse

Description

When ~/.claude/CLAUDE.md is a symbolic link (a common setup for managing Claude Code settings in a separate git repository), the /memory command passes the symlink path directly to the editor instead of resolving it to the real file path.

As a result, VS Code opens ~/.claude/CLAUDE.md as an empty file, making it impossible to view or edit the actual content through the /memory command.

Environment

  • Claude Code version: 2.1.156
  • OS: WSL2 (Ubuntu on Windows, kernel 6.6.87.2-microsoft-standard-WSL2)
  • Editor: VS Code 1.122.0

Steps to reproduce

  1. Set ~/.claude/CLAUDE.md as a symbolic link (e.g., ln -s /home/ubuntu/workspace/claude-code-settings/CLAUDE.md ~/.claude/CLAUDE.md)
  2. Run /memory in Claude Code on WSL
  3. Select "user-memory"
  4. VS Code opens but displays an empty file

Expected behavior

Detect that ~/.claude/CLAUDE.md is a symbolic link and resolve it to the real path before passing it to the editor. This behavior already works correctly in the Windows native environment.

Actual behavior

The symlink path is passed as-is to the editor, which opens an empty file.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Detect that ~/.claude/CLAUDE.md is a symbolic link and resolve it to the real path before passing it to the editor. This behavior already works correctly in the Windows native environment.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix /memory command fails to resolve symlinked user memory file in WSL