claude-code - 💡(How to fix) Fix Session memory rules acknowledged and saved but not retained across sessions

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…

Claude Code has a memory file system — rules and preferences are saved to .md files in a memory directory, read at session start. Despite this process, established rules are repeatedly violated in subsequent sessions. Claude acknowledges the violation, says it will not happen again, and breaks the same rule the next session.

Root Cause

Claude Code has a memory file system — rules and preferences are saved to .md files in a memory directory, read at session start. Despite this process, established rules are repeatedly violated in subsequent sessions. Claude acknowledges the violation, says it will not happen again, and breaks the same rule the next session.

Fix Action

Fix / Workaround

Documented examples (same project, multiple sessions)

  • Issue references: Rule established — always use full issue titles, never numbers alone (e.g. 'Login for Google Github not working (#74)' not '#74'). Rule saved to memory. Violated the next session. Claude said 'I'll use full titles going forward.' Violated the session after that.
  • Tool explanations: Rule established — before every tool call, write a sentence explaining what you are about to do and why. Rule confirmed working mid-session. Dropped entirely the next session.
  • gh CLI PATH: Workaround for gh CLI not found in bash shell rediscovered every session despite being documented in memory.
RAW_BUFFERClick to expand / collapse

Summary

Claude Code has a memory file system — rules and preferences are saved to .md files in a memory directory, read at session start. Despite this process, established rules are repeatedly violated in subsequent sessions. Claude acknowledges the violation, says it will not happen again, and breaks the same rule the next session.

Process in place

  • Session start: memory files are read (feedback.md, session-state.md, etc.)
  • Session end: memory files are updated with new rules
  • Rules are written in plain language with Why and How to apply sections

Documented examples (same project, multiple sessions)

  • Issue references: Rule established — always use full issue titles, never numbers alone (e.g. 'Login for Google Github not working (#74)' not '#74'). Rule saved to memory. Violated the next session. Claude said 'I'll use full titles going forward.' Violated the session after that.
  • Tool explanations: Rule established — before every tool call, write a sentence explaining what you are about to do and why. Rule confirmed working mid-session. Dropped entirely the next session.
  • gh CLI PATH: Workaround for gh CLI not found in bash shell rediscovered every session despite being documented in memory.

Root question

If memory files are confirmed read at session start, why do rules in those files fail to influence behavior within that same session? The files are being read — the rules are not being applied.

Cost to users

Each repeated violation costs tokens to correct, re-document, and re-establish. Users should not have to re-teach the same rule multiple times across paid sessions.

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 Session memory rules acknowledged and saved but not retained across sessions