AI memory files: what your assistant should remember, kept in Markdown
An AI memory file is a short Markdown file of facts an assistant loads each session: preferences, corrections, decisions. What to keep in it and how to prune.

An AI memory file is a Markdown file of durable facts that an assistant loads at the start of each session, so it does not begin from nothing: your preferences, corrections you have already made, decisions and where to find things. It works well kept short, one line per fact, with dates, and split into an index plus topic files once it grows. Keeping memory in a file you can open, rather than only inside an app, means you can read it, fix a wrong entry and use the same memory with another tool.
This post compares built-in memory with file-based memory, then covers what belongs in a memory file, a structure that holds up, and how to keep it from filling with stale or contradictory entries.
How is a memory file different from built-in AI memory?
Built-in memory is stored by the app and managed through its settings. A memory file is a document on your disk that you or the assistant edit directly.
ChatGPT's memory is the built-in kind. OpenAI's Memory FAQ (checked November 2026) describes two experiences, "Improved Memory", which "continually updates a broader summary of relevant context," and legacy saved memories, which "use a more explicit list of individual memory items." You review and delete them under Settings > Personalization > Memory, and a Temporary Chat does not create or update memories.
Claude Code's auto memory is the file kind, and a useful model of how one can work. According to its memory documentation:
- Each project gets a folder at
~/.claude/projects/<project>/memory/. MEMORY.mdin that folder is an index, one line per memory, and the first 200 lines or 25KB of it load at the start of every session.- Each memory is its own Markdown file, such as
feedback_testing.md, which Claude reads only when it needs it. - Memories are typed in front matter as
user,feedback,projectorreference. - The files are "plain markdown you can edit or delete at any time", and they stay on your machine.
| Built-in memory (ChatGPT) | Memory files (Claude Code auto memory, or your own) | |
|---|---|---|
| Where it lives | The provider's service | Markdown files on your computer |
| How you review it | The app's settings | Open the file |
| Correcting an entry | In the app, or by asking the assistant | Edit the line |
| Use with another tool | Not directly | Paste or attach the file |
Neither is better in every case. Built-in memory needs no setup and follows you across devices. A file needs a little maintenance and gives you full control over what the assistant believes.
What should an AI memory file contain?
Facts that will still be true next month and that the assistant cannot work out on its own. Claude Code's documentation draws the line in the same place: auto memory skips "anything it can derive from the codebase" and anything already in CLAUDE.md.
| Keep | Leave out |
|---|---|
| Preferences: "Answers in British English, no bullet points in emails" | Anything in another file the assistant already reads |
Corrections: "The staging database is db-stage-2, not db-stage" |
Passwords, keys, account numbers |
| Decisions, dated: "2026-11-02: dropped IE support" | Today's task list |
| Pointers: "Bug reports are in Linear, project WEB" | Facts copied from documents that will change |
| Who is who: "Dana owns billing; ask before changing invoices" | Feelings about a meeting, guesses, rumors |
The test for each line is whether a new session would make a mistake without it. If not, it is not memory; it is notes.
How should the file be structured?
Start with one file. When it passes a page, split it into an index and topic files, the way Claude Code's auto memory does.
# MEMORY.md
- Writing: British English; short paragraphs; no emoji. See [style](style.md)
- Staging DB is `db-stage-2` (corrected 2026-10-14)
- Billing changes need Dana's OK. See [people](people.md)
- Bugs live in Linear, project WEB
- 2026-11-02: dropped IE support. See [decisions](decisions.md)
And a topic file it points to:
---
type: project
updated: 2026-11-20
---
# Decisions
- 2026-11-02: Dropped IE support after the October usage review.
- 2026-09-14: Moved from MySQL to Postgres for JSON columns.
The index stays small enough to load every time, and detail lives in files the assistant opens only when a line points there. Claude Code applies the same discipline to itself: when MEMORY.md nears its limits, it is reminded to keep one line per entry, move detail into topic files, and merge or drop stale entries, because everything past the limit is dropped at the next load.
How is memory different from instructions?
Instructions say how to work. Memory records what is true. In Claude Code they live in different files on purpose: CLAUDE.md holds the rules you write, such as build commands and conventions, and auto memory holds what Claude learns from working with you. "Run the tests before saying a task is done" is an instruction. "The tests need a local Redis instance" is memory.
Keeping them apart makes both easier to maintain. You review instructions like code and rarely change them; memory changes weekly. CLAUDE.md explained covers the instruction side.
How do you keep a memory file from going wrong?
Treat it like any document that other work depends on.
- Date every decision and correction. A date tells the assistant, and you, which of two conflicting entries is newer.
- Replace, do not append. When a fact changes, edit the old line. Two contradictory lines leave the assistant to choose, and it may choose the old one.
- Prune monthly. Delete entries about finished projects and people who have moved on. Old context is not neutral; it is read as current.
- Read what the assistant wrote. If an assistant maintains the file, skim the changes. A misunderstanding saved to memory repeats in every session after.
- Keep it in Git if the folder is important to you, so a bad edit is a visible diff. Context engineering with plain files covers versioning context files in more depth.
Can you use one memory file with several assistants?
Yes, because it is only Markdown. A coding agent can import or read it from the project folder. In a chat app, you can paste the index into project instructions or attach the file. The content does not depend on any one product, which is the point of keeping it as a file: when you change tools, your assistant's memory comes with you.
Keeping memory files in Noteline
Noteline, which we make, edits memory files as plain .md files in whatever folder you open, including one you keep in a project or a Git repository. The desktop app watches the folder, so when an assistant updates MEMORY.md while it is open, a bar offers Use disk version or Keep my version and your edit is not silently lost. Hidden folders are skipped in the sidebar, so Claude Code's own memory folder under ~/.claude/ is easier to reach through /memory in Claude Code, which opens the files in your editor. Noteline has no AI features and no cloud; the iPhone, iPad and Android apps are free and keep notes as .md files.