claude-code - 💡(How to fix) Fix [FEATURE] Route memory writes by metadata.type — user/feedback should be user-level, not project-scoped [1 participants]

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…
GitHub stats
anthropics/claude-code#58840Fetched 2026-05-14 03:38:09
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this hasn't been filed
  • Single feature request

Problem Statement

The memory system's frontmatter declares a scope hierarchy that the storage location doesn't honor.

The system prompt instructs Claude to write memories with metadata.type of user, feedback, project, or reference. The first two are inherently cross-project — they describe the user and how Claude should work for this user, not facts about one repo. But all memories, regardless of type, are stored at a single project-scoped path:

~/.claude/projects/<encoded-project-path>/memory/

So user- and feedback-type memories — which are 80% of what actually gets written in practice — are trapped in a per-project directory:

  • They don't carry between repos. A correction the user makes in repo A doesn't reach Claude when working in repo B.
  • They duplicate content already in ~/.claude/CLAUDE.md (user-level instructions), producing two parallel rule systems with no clear separation.
  • They get rediscovered and refiled in every new project the user opens.

The mismatch is between the content of the memory (cross-project preferences) and the storage (project-scoped path).

Case study

A user with ~25 saved memories in one project's directory: ~17 are feedback_* files about how the user wants Claude to work ("ask before naming," "no speculation," "red/green tests," "don't push without asking," "presentations are HTML," etc.). All of these apply to every project the user has, but they live in one project's directory and do not load elsewhere. Only ~4 are genuinely project-specific facts (e.g. internal service identities, project-only conventions).

Proposed Solution

Route memory writes by metadata.type:

  • user and feedback~/.claude/memory/ (user-level, loads in every session)
  • project~/.claude/projects/<encoded-project-path>/memory/ (current location, loads when cwd is in that project)
  • reference → either, based on whether the resource is project-bound (a project-specific dashboard URL) vs general (an Anthropic docs link)

Or, less invasive: keep the storage location as-is but also load ~/.claude/memory/ in every session so user-level memories can live there if explicitly written there. Today the system prompt does not even acknowledge a user-level memory dir as a possibility.

Either way, the type field needs to mean something about scope, or it should be dropped.

Alternative Solutions

  • Add a scope: user | project field to the frontmatter explicitly, and let the user decide per-file. Default by metadata.type.
  • Make ~/.claude/CLAUDE.md the canonical home for feedback-type content and stop writing feedback_*.md files entirely.

Priority

Medium — Significant friction for users who work across multiple repos.

Feature Category

Memory / system prompt conventions

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…

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 [FEATURE] Route memory writes by metadata.type — user/feedback should be user-level, not project-scoped [1 participants]