Why your AI forgets your instructions every single time

Updated on

Your AI remembers nothing between sessions: every conversation starts with a blank memory. It only keeps what is written in an instruction file that it re-reads each time it starts. Without that file, you explain your project again every single morning, and it still drifts.

It isn’t a bug, it’s how the thing is built

You explained your project on Monday. On Tuesday it starts from nothing. You explain again. Wednesday, same story.

This is not stubbornness and nothing is broken. The official documentation says it plainly: every session starts with a blank memory. What you typed yesterday no longer exists. What you type today will be gone tonight.

A coding AI works with whatever sits in front of it right now. That workspace is large, but it empties completely when you close the window.

The only thing that survives closing

There is a mechanism built for exactly this: an instruction file placed inside your project, which the AI reads automatically when it starts.

This is not a workaround. It is the official way. The file holds whatever you keep repeating: what the project does, how you want to be spoken to, what is off limits, what must never be touched.

Written once, read every time.

Length matters more than you would think

The natural instinct, once you discover this file, is to pour everything you know into it. That backfires.

The official documentation recommends staying under 200 lines, with a hard ceiling of 40,000 characters. The reason is simple: the longer the file, the more room it eats in the AI’s workspace, and the less closely it is followed.

A short, precise file is respected more than an exhaustive wall of text. It is counter-intuitive, and it is measurable.

What belongs in it

Three things, in this order.

What the project does, in three lines. Not a sales pitch, just enough for it to know where it has landed.

How you want to work. Does it draft a plan before changing anything? Does it ask before deleting? Does it explain, or does it just execute?

What is forbidden. This is the part everyone skips and the part that pays off most. One written prohibition saves hours of repair work.

How to tell whether it worked

Close everything. Reopen. Ask it what your project does.

If it answers correctly without you re-explaining anything, the file is being read. If it asks again, the file is in the wrong place or it is not being loaded, and that is the thing to fix before anything else.

Frequently asked questions

Can I just ask it to remember?
No, not by asking inside the conversation. It will politely agree, then forget the moment you close. The only reliable memory is a file on your disk that it re-reads at startup.
Do I have to write everything into that file?
No, and doing so backfires. The official documentation recommends staying under 200 lines. An overlong file is followed less closely than a short, precise one.
Does this work with every AI?
The principle is the same everywhere. An instruction file is read at startup, and only its name changes from one tool to the next.

Sources

  1. Claude Code documentation — how Claude remembers your project — accessed
  2. Claude Code documentation — the context window — accessed