[FEATURE] /cd across projects loads CLAUDE.md but not auto-memory — make it re-scope (or surface what carried over)

Resolved 💬 2 comments Opened Jun 14, 2026 by FelixIsaac Closed Jun 18, 2026

What it is

First — thank you for the cache-preserving /cd. Being able to switch project directories mid-session without rebuilding the system prompt or losing conversation history is genuinely excellent, and appending the new directory's CLAUDE.md as a message is a clever, low-cost way to pick up project instructions on the fly.

The friction

/cd across projects is asymmetric in a way that's invisible to the user:

  • ✅ The new directory's CLAUDE.md (and parent-tree CLAUDE.md) is loaded (appended).
  • ❌ The new project's auto-memory (~/.claude/projects/<project>/memory/MEMORY.md) is not loaded — auto-memory stays pinned to the git repo the session started in.

I understand from the docs this is intentional (preserve the original session's learnings). The problem isn't the behavior itself — it's that the user has no way to tell what actually "moved." The mental model when you type /cd <other project> is "I'm now working in that project," so you reasonably assume you've inherited that project's full context (instructions and memory). In reality you've inherited its instructions but kept the previous project's memory — silently. You're left guessing which project's state you're operating on.

This bites hardest when the two projects are unrelated (e.g. a personal repo → a separate work project): you can end up doing work in Project B while still memory-scoped to Project A, with no signal.

Suggested improvement

Make /cd across a git-repo boundary either fully re-scope or clearly surface the gap:

  1. Preferred — "act like a fresh session in that project": when /cd crosses into a different git repo, re-scope auto-memory to the new project's memory directory (load its MEMORY.md), the same as if the session had been launched there. This matches the user's mental model: move directory → inherit everything that a fresh session there would have.
  1. At minimum — make it explicit and one-keystroke fixable: on a cross-repo /cd, print a short notice of what carried over vs. what didn't, e.g.:

> Switched to project-b. Loaded project-b/CLAUDE.md. Auto-memory still scoped to project-a (preserved from session start). Run /cd --reload-memory (or press X) to re-scope memory to project-b.

An opt-in flag like /cd --fresh <path> (re-scope everything) vs. plain /cd (preserve memory, current behavior) would also work and keep the intentional default.

Why it matters

Right now the only reliable way to "fully" enter another project is to restart the session in that directory — which throws away the conversation you /cd'd to preserve. That defeats the elegance of /cd. Closing this gap (or just surfacing it) would make multi-project sessions far more intuitive and prevent silent "wrong project's memory" mistakes.

Environment

  • Observed on Windows 11, Claude Code interactive CLI.
  • Repro: start a session in repo A (its MEMORY.md auto-loads) → /cd into repo B → repo B's CLAUDE.md loads but repo B's MEMORY.md does not; memory stays on A.

View original on GitHub ↗

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