[BUG] autoMemoryEnabled=false does not suppress the ~11-16k memory preamble (re: closed #44829)

Status Fixed / completed
Reported on v2.1.149
Maintainer reply None cached
Activity 47 comments · opened May 30, 2026 · closed Aug 17, 2026

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\" bucket | All other buckets |
|---|---|---|
| Sonnet 4.5 (200k window) | 11.3k tokens | normal |
| Opus 4.7 (1M window) | 16.2k tokens | also 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\")

View original on GitHub ↗

47 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/44829
  2. https://github.com/anthropics/claude-code/issues/52488
  3. https://github.com/anthropics/claude-code/issues/29178

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

guillaume-paradise · 4 months ago

do not close, this is still a real issue.

guillaume-paradise · 4 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 4 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 4 months ago

Still present, not a duplicate. Requesting this stay open until fixed.

guillaume-paradise · 4 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 4 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 4 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 4 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 4 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 4 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 4 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 4 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 3 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 3 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 3 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 3 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 3 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 3 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 3 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 3 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 3 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 3 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 3 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 3 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 3 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 3 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 3 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 2 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 2 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 2 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 2 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 2 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 2 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 2 months ago

This bug still affects me on current Claude Code. Keeping open.

guillaume-paradise · 2 months ago

Still reproducible on the latest version. Please keep this open.

guillaume-paradise · 2 months ago

Confirming this is still an active issue and not yet resolved.

guillaume-paradise · 2 months ago

Still present, not a duplicate. Requesting this stay open until fixed.

guillaume-paradise · 2 months ago

Confirming this is still an active issue and not yet resolved.

guillaume-paradise · 2 months ago

Still present, not a duplicate. Requesting this stay open until fixed.

guillaume-paradise · 2 months ago

Confirming this is still an active issue and not yet resolved.

guillaume-paradise · 2 months ago

Still present, not a duplicate. Requesting this stay open until fixed.

guillaume-paradise · 2 months ago

Confirming this is still an active issue and not yet resolved.

marcindulak · 2 months ago

To prevent the issue from being marked as stale it's enough to comment before the 14 days interval used by the bot https://github.com/anthropics/claude-code/issues/30407#issuecomment-4813778775.

On the other hand, you'll receive no email reminder when the bot marks your issue as stale https://github.com/anthropics/claude-code/issues/46083.

guillaume-paradise · 2 months ago

Still present, not a duplicate. Requesting this stay open until fixed.

guillaume-paradise · 1 month ago

Closing our side of this — no longer relevant to our workflow. Thanks for the reports.

vshulcz · 20 days ago

the 11.3k/16.2k figures do not reproduce on 2.1.280, and the flag does work — measured today, macOS, in an isolated config so nothing else differs between the arms:

cd /tmp/empty && claude -p "/context" \
  --settings '{"autoMemoryEnabled":false,"autoMemoryDirectory":"/tmp/empty-mem"}'

/context runs headless, so this is one command per arm rather than a relaunch and a click.

| arm | System prompt | Memory files | cache_creation_input_tokens on a trivial prompt |
|---|---|---|---|
| autoMemoryEnabled: true | 2.2k | 747 | 12,066 |
| autoMemoryEnabled: false | 1.5k | 747 | 11,394 |

the instruction block is suppressed: 2.2k -> 1.5k in the system prompt bucket, and the cache-creation count agrees independently (12,066 - 11,394 = 672 tokens, same prompt, empty memory directory both times).

the part worth correcting is the other column. the "Memory files" bucket does not move with the flag because it is not the preamble — it counts CLAUDE.md. with an empty memory directory and no local CLAUDE.md it reads 747; drop a 4,517-character CLAUDE.md in the cwd and it reads 2k. the user-level ~/.claude/CLAUDE.md on this machine is 1,958 characters, about 515 tokens, which is most of that 747. so the residue that is neither your instruction files nor your memories is on the order of 230 tokens, and that is an upper bound — i cannot separate framing from estimator error without reading the binary, which is what the original report did.

if there is still something to fix here, it is the label: a bucket named "Memory files" that counts CLAUDE.md is what turned this into two issues and forty-odd keep-alive comments. the token claim itself is stale.