claude-code - 💡(How to fix) Fix [BUG] autoMemoryEnabled=false does not suppress the ~11-16k memory preamble (re: closed #44829)

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…

Setting autoMemoryEnabled: false in ~/.claude/settings.json correctly disables auto-memory writes and stops Claude from attempting them, but the hardcoded memory preamble (instructional text + "currently empty" branch + formatting templates) still loads into the system prompt at session start.

This was previously reported in #44829, which was auto-closed by the staleness bot on 2026-05-20 without Anthropic response. Re-filing with concrete measurement.

Root Cause

Setting autoMemoryEnabled: false in ~/.claude/settings.json correctly disables auto-memory writes and stops Claude from attempting them, but the hardcoded memory preamble (instructional text + "currently empty" branch + formatting templates) still loads into the system prompt at session start.

This was previously reported in #44829, which was auto-closed by the staleness bot on 2026-05-20 without Anthropic response. Re-filing with concrete measurement.

RAW_BUFFERClick to expand / collapse

Summary

Setting autoMemoryEnabled: false in ~/.claude/settings.json correctly disables auto-memory writes and stops Claude from attempting them, but the hardcoded memory preamble (instructional text + "currently empty" branch + formatting templates) still loads into the system prompt at session start.

This was previously reported in #44829, which was auto-closed by the staleness bot on 2026-05-20 without Anthropic response. Re-filing with concrete measurement.

Reproduction

  1. ~/.claude/settings.json: { \"autoMemoryEnabled\": false }
  2. Empty the memory directory: rm ~/.claude/projects/<encoded-cwd>/memory/*.md
  3. Fully quit Claude Code app (Cmd+Q), relaunch.
  4. Open a fresh session, run /context before sending any prompt.

Measured impact (Claude Code 2.1.149, macOS)

Model"Memory files" bucketAll other buckets
Sonnet 4.5 (200k window)11.3k tokensnormal
Opus 4.7 (1M window)16.2k tokensalso inflated (+75% session overhead vs Sonnet)

Memory dir contents: 0 files, 0 bytes. The entire bucket is preamble loaded from the binary.

Binary inspection (strings claude.app/Contents/MacOS/claude | grep -i memory) surfaces 4 preamble templates: 27,303 / 22,477 / 4,482 / 105 chars. The smallest is the "is currently empty. When you save new memories, they will appear here." branch — proof the preamble loads regardless of autoMemoryEnabled state.

Impact

  • ~11k tokens/session wasted on Sonnet, ~16k on Opus, for users who have explicitly opted out of auto-memory.
  • For users with 5-tier learning systems (or any non-memory routing), this preamble actively pollutes context by suggesting routes Claude shouldn't take.
  • Scales with usage: at 100 sessions/week, ~1.1M tokens/week of preamble for an opted-out user.

Requested behavior

When autoMemoryEnabled: false:

  • Skip the memory preamble entirely (no instructional text, no "currently empty" branch, no format templates).
  • /memory slash command can still work via lazy-load when explicitly invoked.

This is the fix #44829 originally requested — restating with measurement so it doesn't sit idle until the bot closes it again.

Related

  • #44829 (closed-as-inactive 2026-05-20, NOT_PLANNED — no Anthropic response)
  • #56329 (open: "Optionally disable memory" — more general request)
  • #52488 (closed: "decouple CLAUDE.md and MEMORY.md controls")

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 [BUG] autoMemoryEnabled=false does not suppress the ~11-16k memory preamble (re: closed #44829)