r/ClaudeCode • • 15h ago

Discussion Claude Code - Memory prefetch

Found this while digging into how Claude Code (2.1.311) loads MEMORY.md and the notes it indexes.

What the docs say: each session loads only your MEMORY.md index: the first 200 lines or 25KB (or to be precise 25000 char length - it counts UTF-16 units: one per ordinary character, two per emoji or other characters outside the basic plane), whichever comes first. Your topic notes stay on disk until Claude opens one with its file tools.

What the 2.1.311 binary also has: an undocumented recall step.

On each turn a selector model is asked to "Select memories relevant to:" your prompt, and up to 5 note files get attached, each cut at 200 lines or 4 KB. It sits behind a server-side feature flag. The flag is off by default. The flag name is `tengu_mill_orange`, recall turns on only when Anthropic's server sends `tengu_mill_orange: true` for your account. There's no local switch.

So if you lean on the default memory: keep the index short, and put anything that must always apply in CLAUDE.md or .claude/rules/, not in a note you hope gets picked.

Disclaimer: found while building a context x-ray for Reporails diagnostics

1 Upvotes

1 comment sorted by

•

u/AutoModerator 15h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.