Free guide

Memory for AI: what to put in CLAUDE.md and when to start a new chat

AI doesn’t remember all of yesterday’s conversation. The only thing it reliably knows is the file it reads at the start of every chat. Below you’ll find where that file lives in Claude Code and on claude.ai, a ready-made template and how to tell it’s time to start a new chat.

  • 5
    min read
  • Checked

  • From an Instagram video
Sample

CLAUDE.md

Who I am: Jana, a flower shop in Brno. Project: a website for ordering bouquets. Rules: we address customers formally, don’t change prices without approval. Decided Oct 14: card payment. Next: the order form.

At the end of the day

Add what we decided today to CLAUDE.md.

In short

What AI should know in every chat belongs in a file, not in the chat history: in Claude Code in CLAUDE.md, on claude.ai in the project instructions. A long chat fills up over time, and details drop out of it. A new chat reads the file and carries on.

Why a long chat forgets the beginning

  1. A chat has a window: how much text the model can hold at once. When a long conversation gets close to the edge, Claude Code summarizes the older messages, and claude.ai does so only with code execution turned on. The main thread stays, but an instruction given only in the chat can get lost along the way. In our video, Claude explained it by saying “the beginning didn’t fit anymore”.
  2. A new chat doesn’t start with the whole history. Claude Code starts with an empty window and loads only CLAUDE.md and its own notes from earlier. On claude.ai, Claude has a memory with the main facts about you and your work, but it chooses for itself what to save there.

Where to store the memory

  1. In Claude Code: a CLAUDE.md file in the project folder. It loads automatically at the start of every conversation. Rules for all your projects belong in ~/.claude/CLAUDE.md.
  2. Have the first version written for you: the /init command goes through the project and puts CLAUDE.md together itself. The /memory command opens the memory files for editing.
  3. Claude Code’s own notes: an automatic memory where Claude writes down your corrections and preferences. It’s on from the start, and you can also look through it via /memory. But write the rules that matter to you in CLAUDE.md: you decide what goes in it.
  4. On claude.ai: Projects. Put everything Claude should know in every chat of a project into the project instructions and its files. Each project also has its own memory.
  5. Keep long work in one project, not in one endless chat.

A ready-made CLAUDE.md template to copy

Copy it into CLAUDE.md or into the project instructions on claude.ai. The example is filled in for a flower shop: rewrite it for your own project.

Who I am: Jana Nováková, a flower shop in Brno. Call me Jana and write in English.

Project: a flower shop website for ordering bouquets. The code is in this folder.

Rules: we address customers formally. Don’t change prices without my approval. Show me any email to a customer before it’s sent.

Decisions: on Oct 14 we chose card payment. On Oct 18 we ruled out delivery outside Brno.

Done and next: the catalog is done. Next steps: the order form, the confirmation email, photos of the bouquets.

200

lines is the recommended upper limit for one CLAUDE.md file. A longer file takes up more room in the window, and Claude follows it less well.

Anthropic, Claude Code docs, 2026 · source

Don’t put passwords, keys or customer data in memory. Every new chat reads it, and the project’s CLAUDE.md is saved along with the code, for example to GitHub, where anyone who can see the code will see it.

Bonus: don’t write down only tasks. “Forgets to eat dinner” is a useful line too: in our video, Claude didn’t lose it.

How to tell the window is running out and when to start a new chat

  1. How you’ll know: the answers get muddled and agreements from the start get lost. In Claude Code, the /context command shows how full the window is, and you get a warning before compacting.
  2. Write down the decisions before you leave. In Claude Code, write: “Add what we decided today to CLAUDE.md.” On claude.ai, have the decisions summarized and add them to the project instructions.
  3. Open a new chat. It reads the file and picks up where you left off.
  4. In Claude Code, the /compact command condenses the conversation and /clear starts a new one. The project’s CLAUDE.md stays in both cases.

Bonus

An end-of-day prompt

Before you close the chat, give the AI this task and paste the result into memory:

Summarize what we decided today and what the next step is, in five lines at most, for CLAUDE.md. Don’t put passwords, keys or customer data in the summary.

Want an AI that knows your company from the first message?

In a free 30-minute call, we’ll go through what AI should know about your company and suggest where to write it down so it applies in every chat.

Everything we offer

Free estimate

In 30 minutes, you’ll know where to start and roughly what it will cost.

  1. Topic
  2. Company
  3. Contact
What do you need help with?

Tell us about your company
How many people work at your company? (optional)
Where is your company based? (optional)
How did you hear about us? (optional)
Where can we reach you?
How should we contact you

Add a note (optional)

Within one business day, we’ll get back to you and arrange a time.