{"version":"2.1.284","anchor":"auto-memory-files-are-sanitised-when-loaded","canonical_anchor":"auto-memory-files-are-sanitised-when-loaded","heading":"Auto-memory and pinned memory are cleaned before use","tier":"notice","area":"Memory","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.284\/e\/auto-memory-files-are-sanitised-when-loaded","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.284","markdown":"### Auto-memory and pinned memory are cleaned before use\n\nAutomatically written memory and pinned memory now have hidden characters cleaned out and tag-like text escaped before they reach Claude\n\n**Unclear.** Exactly which characters are removed is not settled.\n\n**What**\n\nAuto-memory is the notes Claude Code writes for itself to remember things between sessions. Pinned memory is memory marked to always be included. Both are now cleaned before Claude sees them.\n\n- When memory files of type `AutoMem` and `AutoMemPinned` are loaded, line endings are normalised: `\\r\\n`, `\\u2028` and `\\u2029` all become `\\n`. Control and formatting characters also appear to be removed. Before, only `AutoMem` got this treatment, and pinned content was used exactly as read.\n\n- If cleaning changes a file, Claude Code notes that the content differs from what is on disk and keeps the original text alongside it.\n\n- `AutoMem` entries and `<pinned-memory>` blocks are now escaped before they go into the prompt. A backslash is placed after the `<` of anything that looks like an opening tag, so memory text cannot open or close the tags Claude Code uses to structure the prompt. Before, the content was only trimmed.\n\n**Why**\n\nMemory written automatically can pick up hidden characters or text that looks like instructions or tags. Cleaning and escaping it keeps such content from changing how the rest of the prompt is read.\n\n- Area: Memory\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 2\/5"}