CLAUDE.md, auto memory and Brand Brain: how to give AI a brand memory
Every Claude Code session starts from scratch. The model doesn’t remember yesterday’s conversation, the correction you made last week or the tone of voice that took months to get right. Anyone using AI for brand work feels this daily: the text comes out generic until someone pastes the positioning, the list of banned words and the approved examples all over again.
Claude Code has two ways to carry knowledge from one session to the next: CLAUDE.md and auto memory. In this third piece of our series on AI agents, we explain how both work, based on the official documentation checked in October 2026, and why we built a third layer for brand work, the Brand Brain.
Why AI forgets
The model works inside a context window, which is everything it takes into account in a conversation. When the session ends, the window is gone. When the conversation runs too long, Claude Code compacts the history into a summary, and details that were only said in the chat can get lost along the way.
The fix is to move knowledge out of the conversation and into files that Claude reads again at the start of each session. Claude Code’s two mechanisms do this in different ways: you write the CLAUDE.md, and Claude writes the auto memory.
What CLAUDE.md is
CLAUDE.md is a text file with instructions that Claude reads at the start of every session. Depending on where it lives, it can apply to one project, to you across all your projects or to an entire organization.
| File | Applies to | Good for |
|---|---|---|
~/.claude/CLAUDE.md | You, in every project | Personal working preferences |
CLAUDE.md at the project root | Everyone who works on the project | Project rules, shared through the repository |
CLAUDE.local.md at the project root | Only you, in that project | Personal tweaks that shouldn’t be shared |
| File managed by the company | Every user in the organization | Mandatory policies and standards |
When there are several, Claude reads all of them and combines the content, from the broadest to the most specific. To get started, the /init command analyzes the project and generates a first CLAUDE.md, which you then adjust with what Claude couldn’t figure out on its own.
How to write a CLAUDE.md that works
The documentation suggests staying under 200 lines per file. A long file takes up context in every session and, according to Anthropic itself, makes Claude follow the instructions less closely. It also asks for specific instructions: “write in US English and never use a hyphen as a dash” works better than “write well”.
Instructions that contradict each other are a quiet problem. If one passage says “formal tone” and another says “friendly tone”, Claude may follow either one. It pays to reread the file every so often and delete whatever has gone stale.
A CLAUDE.md can pull in other files with @path/to/file, up to four levels deep. That keeps things organized, but the imported file also loads in every session, so it saves no room. For rules that only apply to part of the project, the .claude/rules/ folder accepts files with a paths field, which only load when Claude touches files under that path.
One last point tends to surprise people: CLAUDE.md works as context and can’t block anything. Claude tends to follow it, but it can slip. When an action must always be prevented, such as deleting a deliverables folder, the way to go is a hook, a command that Claude Code runs before the action and that can stop it.
What auto memory is
Auto memory is the notebook Claude keeps on its own. As it works, it records what might help in a future conversation: who you are and how you like to work, the corrections you made, project decisions that aren’t in the code and where to find information outside it.
The notes live in ~/.claude/projects/<project>/memory/, one per file, with an index called MEMORY.md. The index loads in every session, up to the first 200 lines or 25 KB. Claude doesn’t store what it can learn by reading the project or what the CLAUDE.md already says. With the /memory command, you turn it on or off and check what was saved.
In our website project, auto memory holds 87 notes. One reminds Claude that the site’s cache needs a specific command before the published page actually changes. Another records that, when translating a post, the language has to be saved before the category, or the post disappears from the listing. None of this had been written down anywhere before.
Auto memory makes mistakes too. If Claude notes something it didn’t verify, the note starts to look like fact in later sessions. That’s why it’s worth opening the folder now and then and deleting whatever is wrong or out of date.
What brand work still needs: the Brand Brain
CLAUDE.md and auto memory are tied to one project and one person. A brand needs something else: knowledge that holds in any project, that several people use and where every claim has a source. That’s why we built the Brand Brain, the brand memory our agents consult before producing anything.
The Brand Brain is a folder of text files organized by subject. It starts with sources and open questions, moves on to strategy (positioning, value proposition, territories), audience (customer profile, pains, objections, the words customers use) and voice (tone, lexicon, what the brand never says and calibrated examples). After that come the visual kit, governance, activation and a decision log.
Two rules make a difference. First, no claim goes in without a source. Whatever the brand material doesn’t answer becomes an open question, never a guess written up as fact.
Second, when a request contradicts the brain, whoever is producing chooses between following the rule, making an exception for that one piece or changing the rule, and the choice is recorded along with the version.
The brain doesn’t load in full, either. At production time, the agent consults only the sections that matter for that piece: a caption pulls voice and what the brand never says, a visual piece pulls the kit. Skills follow the same logic, loading only when the task calls for them.
How the three layers fit together
| CLAUDE.md | Auto memory | Brand Brain | |
|---|---|---|---|
| Who writes it | You | Claude | The team, from the brand material |
| What it holds | How to work in this project | What Claude learned from you | What the brand is and what it can say |
| Scope | One project, one person or the company | One project | One brand, in any project |
| Loads | In every session | Index in every session | By section, when the piece calls for it |
| Source | Whoever wrote it | The conversation | A document cited for every claim |
One way to picture it: CLAUDE.md is the team’s working manual, auto memory is the notebook of the person doing the work, and the Brand Brain is the brand’s book, with footnotes.
Where to start
Run /init in the project and trim the generated file until only what applies to everything is left. Add the three or four instructions you repeat most often. Leave auto memory on and, after two weeks, read what it has kept.
For the brand, start with three files: the positioning in one paragraph, a list of what the brand never says and five examples of approved texts, each with its source. Examples tend to teach AI more than any description of tone. When reviewing, the rules in our map of AI writing patterns help you build that list.
The other pieces in the series cover subagents, which consult this memory in separate contexts, and skills and plugins, which package the lookup so the whole team uses it the same way.
The full series
This piece is part of a five-part series on AI agents applied to brand work:
- Subagents and agent teams in Claude Code
- Skills and plugins in Claude Code
- CLAUDE.md and Brand Brain: brand memory for AI (this piece)
- How to review AI-generated content
- How we use AI in Headcore’s operations
Frequently asked questions
What is the difference between CLAUDE.md and auto memory?
You write the CLAUDE.md, with instructions and rules, and it is read in full in every session. Auto memory is written by Claude itself, with what it learns from your corrections and preferences, and only its index loads in every session, up to 200 lines or 25 KB.
Does CLAUDE.md guarantee that the AI follows the rules?
No. Claude treats CLAUDE.md as context and tends to follow it, especially when the instructions are short and specific. To always prevent an action, the documentation recommends a hook, which runs before the action and can block it.
What is the ideal size for a CLAUDE.md?
The documentation suggests fewer than 200 lines per file. Larger files take up more context and make Claude follow them less closely. Rules that only apply to part of the project can go in .claude/rules/ with the paths field, which loads only when needed.
What happens to instructions when the conversation is compacted?
The CLAUDE.md at the project root is read again from disk after compaction. Instructions given only in the conversation can get lost in the summary. If an instruction needs to last, it belongs in the CLAUDE.md.
Can you give AI a brand memory without Claude Code?
Yes. The Brand Brain is a folder of text files, and any tool that reads files can consult it. What Claude Code adds is automatic lookup: the agents read the right sections before producing, without anyone having to paste the material into the conversation.
What is the difference between a Brand Brain and a brand book?
A brand book is made for people: it shows how the brand should look and sound. A Brand Brain is made to be consulted by a machine before it generates anything, with every claim tied to its source and open questions where the material has no answer. The brand book’s visual kit lives inside the brain.
Source: Claude Code documentation on memory, checked on 21/10/2026.