Free swapsClaude Code & CodexPromptsSkillsAbout
← Claude Code  ·  The memory file guide

Claude forgets your project. Give it a memory file.

Timeabout 10 minutes in total
Cost$0 extra, needs a paid Claude plan or an Anthropic Console account

Every time you start a new session, Claude starts from zero. It does not know your channel, your tone or the rules you gave it yesterday. Two built-in fixes solve this: a text file called CLAUDE.md that you write once, and automatic notes that Claude takes on its own. This guide shows how to write a short starter file, how to check that Claude reads it, and what it costs.

Words used here
  • session: one conversation with Claude Code, from when you start it until you close it.
  • token: the unit Claude counts its working memory in, roughly three quarters of a word.
  • prompt: the message you send to the AI.
  • terminal: a window where you type commands instead of clicking, such as PowerShell on Windows.
Three kinds of memory
  • Working memory: how much Claude can hold in one conversation. The command /context measures it in tokens.
  • Memory file: the CLAUDE.md file you write. Claude reads it at the start of every session.
  • Automatic notes: files Claude writes for itself about you and your project. It reads them again in later sessions.
Before you start
  • Claude Code installed and signed in. If you do not have it yet, follow Install Claude Code on Windows first.
  • A folder for your project, for example one for your channel.
  • Notepad, or any plain text editor.

Why Claude forgets

A session ends when you close it, and Claude keeps nothing from it by itself. Two things carry over: your memory file and the automatic notes. Both load at the start of every session, and Claude follows them from the first message.

1. Write the file

Create a plain text file called exactly CLAUDE.md in your project folder, the one you open Claude Code in. Notepad likes to save it as CLAUDE.md.txt, which Claude does not read. In the Save window choose "All files" as the type, or turn on "File name extensions" in File Explorer to check the name.

Here is a starter for a content channel. Make every rule concrete: "Keep video titles under 50 characters" works better than "write good titles".

CLAUDE.md# My channel - I run a small gardening channel for beginners, called Green Thumb Weekly. - My viewers have no experience and a balcony, not a garden. - Write in the first person, in plain words, like I am talking to a friend. - Keep video titles under 50 characters. - When you are not sure about a fact, say so instead of guessing. - End every script with a question for the comments.

Put in facts Claude should know in every session: who you write for, your tone, your standing rules. Add a line whenever you catch yourself typing the same correction a second time.

2. Check that it loads

Open Claude Code in that folder and type this in the message box.

Type this inside Claude Code, in the message box

> /context
You should see: a table with a line called Memory files, and under it the path of your CLAUDE.md with its size in tokens. If the file is missing from that list, Claude cannot see it.

You can also ask a question that only the file can answer. Type this in PowerShell, in the folder where the file lives.

Type this in PowerShell

$ claude -p "What is the name of the channel and what is it about?"
You should see: the name and the topic from your file, for example The channel is called Green Thumb Weekly, and it is about gardening for beginners. If Claude says it has no context, it did not find the file.

Before and after

The same questions in two empty folders, one with a short memory file and one without.

TestWithout the fileWith the file
Asked: "What is the name of the channel and what is it about?""I do not have enough context to say which channel you mean.""The channel is called Green Thumb Weekly, and it is about gardening for beginners."
Asked for a video intro, 3 runs each: length7 to 11 sentences, with staging notes2 sentences, every time
Same 3 runs: channel name in the intro0 of 33 of 3
Without the file"Video intro: Composting. [Visual: close-up of a hand pulling apart dark, crumbly soil.] What if I told you that the banana peel in your trash right now could be the secret to the best garden you've ever grown? ..."
With the file"Welcome back to Green Thumb Weekly, where today we turn kitchen scraps and yard leftovers into rich, free fertilizer your plants will love. By the end of this video, you will know exactly how to start your very first compost pile, even if you have never touched a shovel."

Rules show best when they ask for something specific that Claude would not do on its own. With the rule "Always end every answer with the exact line: Happy growing!", Claude added that line every time, which is an easy way to see that the file works.

What the file costs

The file is sent at the start of every session, so every line uses some of Claude's working memory every time, whether the line is useful or not. Keep it under 200 lines. A 200-line file takes about 6k tokens before you type a word.

FileSizeShown in /context as
4 short lines246 bytes97 tokens
50 lines4 KB1.4k tokens
200 lines18 KB6k tokens
600 lines56 KB17.9k tokens
2,000 lines188 KB61.1k tokens
A file named CLAUDE.md.txt246 bytesnot listed until you rename it to CLAUDE.md

The rule of thumb: start with the 6 or 7 rules you repeat most, and add a line only when you catch yourself repeating a correction.

Automatic notes

This is the second fix, and it needs nothing from you. As you work, Claude saves notes for itself about your preferences and corrections, and it reads them in later sessions. It is on by default. Type /memory inside Claude Code to open the notes folder or switch it off.

Try it. In an empty folder, tell Claude: "Remember that my channel is about balcony gardening, I post on Tuesdays and Fridays, and I always want video titles under 50 characters." Then start a brand new session and ask when you post.

You should see: Claude answers Your channel is about balcony gardening, and you post on Tuesdays and Fridays. It saved a few small text files, an index called MEMORY.md and one file per note.

The notes are plain text on your PC. You can read, edit and delete them, and they do not follow you to another computer. Use the memory file for rules you want exactly as you wrote them, and let the automatic notes collect the small things Claude learns from your corrections.

If something looks off

Claude does not seem to know my file

Check the name first. It must be exactly CLAUDE.md, not CLAUDE.md.txt. Then check that you started Claude Code in that folder or in a folder below it, and type /context to see whether the file is listed under Memory files.

Some rules show up more than others

Concrete rules show up most. Rewrite "write nicely" as something you could check, like "keep titles under 50 characters", and make sure no two lines say opposite things.

I told Claude something and want it to remember it

Ask Claude to "add this to CLAUDE.md", or type /memory and look at what the automatic notes saved.

How to get the best result

Want more ways to get the most out of Claude Code? Follow my content and check my other posts.

Get the next guide when it is ready.

One email a week at most, and you can leave whenever you like.

One email at most per new guide. Unsubscribe any time.