claude-code - 💡(How to fix) Fix Memory system: stored rules frequently not consulted before acting [1 comments, 2 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#45322Fetched 2026-04-09 08:08:02
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
1
Timeline (top)
labeled ×3commented ×1cross-referenced ×1
RAW_BUFFERClick to expand / collapse

Problem

Claude Code's auto-memory system correctly stores user feedback and conventions, but the model frequently fails to consult those memories before taking action. This is especially pronounced with style and formatting conventions that have been corrected multiple times.

Example

A user has a memory entry (feedback_block_comment_spacing.md) that clearly states: trailing blank // lines in multi-line comments should only precede function/class definitions, not const declarations. Despite this rule being stored and indexed in MEMORY.md, the model repeatedly adds the trailing // before const declarations anyway — requiring the user to correct the same mistake across multiple conversations.

Impact

  • Users lose trust in the memory system when they have to re-correct behavior that's already been saved
  • The value proposition of memory ("so the user doesn't have to offer the same guidance twice") is undermined
  • Users end up spending time managing memories that don't reliably influence behavior

Expected behavior

Before emitting code that touches areas covered by stored feedback memories (comment style, naming conventions, test patterns, etc.), the model should actively check relevant memories and apply them. The memories are already loaded into context via MEMORY.md — the issue is that they aren't being used to gate output.

Environment

  • Claude Code CLI
  • Model: claude-opus-4-6 (1M context)

extent analysis

TL;DR

The model needs to be modified to actively consult and apply stored feedback memories before generating code.

Guidance

  • Review the code generation pipeline to ensure that the model is correctly querying and applying the relevant memories stored in MEMORY.md before emitting code.
  • Verify that the memories are being correctly loaded into context and that the model has access to the necessary information to apply the stored conventions.
  • Check the model's configuration and parameters to ensure that it is set up to utilize the stored memories, particularly for the claude-opus-4-6 model with a 1M context.
  • Consider adding logging or debugging statements to track how the model is using the stored memories and identify potential issues.

Example

No specific code snippet can be provided without more information about the model's implementation, but a potential solution could involve modifying the code generation function to include a step that checks the relevant memories and applies the stored conventions.

Notes

The solution may depend on the specific implementation details of the Claude Code CLI and the claude-opus-4-6 model, which are not provided in the issue description.

Recommendation

Apply a workaround by modifying the model's configuration or code to ensure that it correctly consults and applies the stored feedback memories, as this is a critical issue that undermines the value proposition of the memory system.

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

Before emitting code that touches areas covered by stored feedback memories (comment style, naming conventions, test patterns, etc.), the model should actively check relevant memories and apply them. The memories are already loaded into context via MEMORY.md — the issue is that they aren't being used to gate output.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING