You type into the chat: keep it short, five sentences at most. Claude Code keeps it short. Everything works, and for a while it looks as though writing anything into a file is a pointless ritual.
Then you close the terminal, come back the next morning, and get three paragraphs in answer to a question that fit on one line. Here is where that comes from, and how to recognise the request that is better off in a file.
What disappears when you close the session
Every new conversation in Claude Code starts without the data from earlier chats – yesterday’s decisions are not available in it until somebody writes them down somewhere. That is simply how it works: a conversation exists for as long as it lasts.
So a request typed into the chat lives exactly as long as that one session. An instruction written into the CLAUDE.md file, which Claude Code reads in your folder at the start of every conversation, comes back each time – and that is the whole difference between the two.
It sounds obvious until you count how many times a week you type the same sentence.
The chat instruction goes earlier than you think
There is a second moment when a request you typed stops working, and it slips past you easily, because nothing as obvious as closing a terminal happens along with it.
Once a conversation gets long, Claude Code summarises its older part to make room for what comes next. A request from two hours ago may not make it into that summary. Instructions from the CLAUDE.md file in your project folder do make it, because Claude Code reads the file off the disk again after the compaction and puts its contents back into the conversation.
Compaction is where the impression comes from that Claude Code “suddenly stopped listening” in the middle of a session that was going well. It did not stop – it simply no longer has the sentence from three hours ago in front of it.
Things meant to happen once
The tempting conclusion here is to write down everything, and it would be the wrong one, because most requests have every right to leave along with the conversation.
“Go through this folder and tell me what is in it.” “Change the company name in these three files.” “Give me a summary of this document.”
Those are one-off instructions and they belong in the chat. Writing them into a file would gain you nothing, since they will not be true tomorrow, and a file full of stale instructions gets in the way more than it helps.
This group is bigger than it looks, and that is good news: most of what you type to Claude Code does not need to go anywhere. The work happens in conversation, and that is how it should be.
Things meant to hold every time
“Write to me in English.” “Do not change anything in the templates folder without asking.” “Dates in DD.MM.YYYY format.” “I am not a programmer, so explain technical things in plain language.”
Sentences like these describe the boundary conditions of your work. They will be true tomorrow, next week, and in every new terminal window. These are exactly the requests that go into CLAUDE.md, because otherwise you retype them at every start – usually in a shortened, steadily less precise form, since by the fifth time nobody feels like typing the whole sentence.
One sentence sorts a request into this group: will I type this again tomorrow, on a different task? If yes, it is a candidate for the file. If no, it stays in the chat and nothing bad happens.
The mechanics of the file itself – what it is called, where it lives, how to check that it worked – are a separate lesson, about your first CLAUDE.md file. This piece is only about deciding what goes inside.
One CLAUDE.md, or several?
That split looks sharper than it really is, because instructions do not have to sit in a single CLAUDE.md. Started in some folder, Claude Code reads the instructions file not only from there – it walks up the directory tree and picks up every one it finds along the way, from the most general down to the folder you are standing in.
What comes out of that is a cascade, and the easiest thing is to map it onto how you keep your files anyway. For somebody working with a few clients it might look like this. In the folder that holds all of your work: whatever is always true, such as the language to write in, how to explain technical things, what not to assume about you. In one client’s folder: whatever concerns that client only. In the folder of a specific job: the details of that one job. You start Claude Code in the job folder and get all three layers at once.
The gain is twofold. You do not have to cram rules for every occasion into one CLAUDE.md, so while you work for one client there is not a word in front of you about the others. And since Claude Code reads only the files leading down to the folder you are working in, it burns fewer tokens at startup than it would reading one enormous list of everything the two of you have ever settled.
You set each of these files up the same way, in the folder it is meant to govern: either ask Claude Code for it, as above, or type /init, and it will look through the folder and write the first version by itself. If a CLAUDE.md is already sitting there, /init will not overwrite it – it will suggest what to add.
When it actually pays off
On a job you will never return to, writing anything down is a waste of time. It starts paying off roughly when you come back to the same folder for the third time.
One practical hint that works better than resolving to “write myself a proper file”: do not set it up in advance, add to it on repetition. You notice that you are explaining the same thing to Claude Code as last time – that is the moment, because you now have proof it was not a one-off.
You open nothing and type none of it yourself, because adding a line is something you ask for like any other piece of work:
This is the second time I am asking you for the same thing: [type what it is here]. Add it to CLAUDE.md in this folder, the instructions you read at the start of work. Show me first how you want to word it, and change nothing until I approve it.
After you send that, you get a proposed sentence to approve, and once you agree – a request for permission to write the file. If there is no CLAUDE.md in the folder yet, Claude Code will create one along the way.
This order has one more advantage: a CLAUDE.md written in advance tends to swell with rules nobody needed, while one that grows out of real repetitions holds exactly what proved itself. That is how it works for us at JUSTAUTOMATE, and not one of those files came out of a single sitting.
The memory Claude Code keeps by itself
Automatic memory is the third route here, and where it stops matters more than the fact that it exists. Claude Code keeps it on its own, with no involvement from you: it takes notes on what follows from your corrections. You correct it on something, and it may save itself a conclusion for later – without asking you and without a single click. May, because what deserves remembering is its own call.
The trouble is that the convenience of this mechanism is also its weakness. What reaches the conversation at startup is only an index of the saved notes, one line each – an index Claude Code maintains itself. The notes themselves sit in separate files, and it reaches for them only once it decides they will be useful in this conversation. That judgement rests on a single line from the index, so sometimes it comes out wrong: a note that would have settled the matter goes unread, and you see no signal that anything was skipped.
Here is where CLAUDE.md wins outright: the file loads in full, at the start of every conversation, with nothing along the way deciding whether it is needed. Let automatic memory grow in the background as a convenient extra, but whatever you genuinely care about, put it in the file.
And one trap that is easy to walk into right now, having just learned that one beats the other. “Remember to do it this way” sounds like a request to record a rule permanently, and Claude Code reads it as an instruction to add a note to automatic memory – which lands it exactly where it later decides for itself whether to look. When the file is what you want, type it plainly: “add this to CLAUDE.md”.
In short
One question settles it: will you type this again tomorrow, on a completely different job? If not, leave it in the chat, that is where the request belongs and none of it needs to go anywhere. If yes, and you catch yourself doing it a second time, ask for one sentence to be added to CLAUDE.md and get back to work.
The instructions file exists to spare you typing the same sentence a fifth time – that much and no more. The rest of it belongs in the conversation, where it does no harm at all.