/init is the command meant to write CLAUDE.md for you: it looks through the folder you run it in and turns what it finds into a file of instructions. That’s the promise. In practice one folder gives you a finished file in a moment, and another gives you a question about whether you really meant this folder. We typed /init into three folders with different contents, and here’s what happened in each.

Where the content of CLAUDE.md comes from

There are two ways to get a CLAUDE.md. The first is a conversation: you ask Claude Code to interview you about the project, you answer, and the file comes out of your answers. The second is /init, which asks nothing – it reads the folder and assembles the file from what’s in there.

Whether /init runs at all comes down to one thing: does the folder hold code. That is a condition of the command itself. You can have a CLAUDE.md in any folder at all, you just have to ask for it differently in some of them.

An empty folder

Our first test folder is completely empty – not one file, not even a hidden one. /init does nothing there and says why: there’s nothing to document, and inventing a CLAUDE.md would be making things up. What it does instead is ask whether we really meant this folder.

The same happens in a folder holding a single short note with an idea: “Sort out the offers and the price list for 2027.” One sentence about an intention is still not enough for /init.

With no documents at all, the conversation is the way in: you talk about the project and Claude Code writes the file from that. Our lesson on your first CLAUDE.md walks through it.

A folder of documents

The second folder has plenty in it: an offer template in Word, a contract template, a price list in Excel and a file with three notes – the ordinary working life of a one-person training business. /init refuses here too, with the same reason: this isn’t a repository with code, so the command won’t run.

You can be more specific with it, though. After the command itself, add a space and a sentence of your own, in plain English, the way you’d write it in a chat. The documentation says nothing about this kind of addition, but it has worked for us every time.

/init for a folder without code

Now Claude Code goes through the folder and writes a CLAUDE.md based on what it finds. It notes that the file says nothing about the project’s tech stack, because the folder holds no such information. Which is right: we work on offers and a price list here, so a paragraph about technology would be filler.

A folder with code

The third folder holds a real repository: code, one test, a README and a history of changes in git. If those words mean nothing to you, that’s good news – this scenario isn’t yours, yours is described above. Here /init does exactly what the documentation promises: it writes a file with the commands for running and testing the project, plus a description of how the thing is put together.

In our test it also threw in a remark nobody asked for: it noticed that the code and the test share the same in-memory list, so the next test somebody adds may fail if the AI assumes the list starts out empty. Claude saved that as a note for later and left the code alone.

The generated CLAUDE.md is only a draft

Whichever of the three folders resembles yours, generating a CLAUDE.md with /init isn’t something you can tick off and forget. The documentation puts it plainly: after /init you refine the file with instructions Claude Code couldn’t have discovered on its own. Your files will tell it what’s in the folder and what rules follow from that. They won’t tell it which folders are off limits without asking. Or that you don’t work with code and would rather have things explained simply.

That’s the first half of the job done for you. The second half you can hand over too, except that this time you’re the source, not the folder. Paste this into a conversation:

Read the CLAUDE.md in this folder and tell me in your own words what it says. Then ask me a few questions about the things that can't be read out of the files: how I want to work, what you must never touch without asking, and what I don't know how to do. One question at a time. Suggest what to add to the file, but don't change anything until I approve it.

Running it a second time in the same folder

Prices change, new document templates arrive, and the CLAUDE.md written at the very beginning drifts further from reality every month. You can run /init again in the same folder without losing what the file already says. It won’t overwrite an existing file, it will propose changes to it. In a folder without code, add the same sentence you added the first time: /init for a folder without code.

In short

Code in your folder? Type /init and read what comes out. Documents, spreadsheets and templates? Tell the command what it’s looking at: /init for a folder without code. An empty folder, or one note in it? Talk about the project in a conversation instead, and come back here once there are files to read.

The good news is that a folder of offers and price lists gets a real file too. You just have to say what Claude Code is dealing with.