Bolek › Guides

How to write a CLAUDE.md file that Claude Code actually follows (2026)

Guide · · Maciej Głuszak · .md version · Polski

In short: CLAUDE.md is the rules file Claude Code reads at the start of every conversation. The fastest way to write it is to let the assistant interview you and build a short file from your answers.

Paste into Claude Code:

Interview me – at most 7 questions, one at a time – and based on my answers write a CLAUDE.md in this folder: what language to reply in, what not to do without asking, how to name files and how to check the result. At most 40 lines, one sentence per rule.

Updated: · tested on: Claude Code 2.1, Windows 11

Claude Code does not remember the previous conversation. It remembers what you write in CLAUDE.md – the assistant loads it at the start of every conversation and treats it as a manual for working with you. Bolek, our AI assistant for Windows, has stood on such a file since day one, so everything below comes from daily use.

Where the file lives and which one wins

filewherewhat for
CLAUDE.md in the project folderthe folder where you run clauderules for one project: names, folder layout, how to check results
CLAUDE.md in your profilethe .claude folder in your user profilerules for all projects at once: language, tone, what not to do without asking

The assistant reads both. When rules conflict, the one closer to the work wins, i.e. the project file. Write language and tone once, in the profile.

Step by step

  1. Open a terminal in the project folder and run claude.
  2. Paste the prompt from the box at the top of this page and answer the assistant's questions.
  3. Read the finished file and strike every rule you do not understand or disagree with.
  4. Start a new conversation and check that the assistant follows the rules – for example ask for a new file and look at its name.
  5. When you correct the assistant a second time on the same thing, add it to the file in one line.

The built-in /init command also creates such a file, but it mostly describes the code of the project. If you use it, review the result against the skeleton below.

The skeleton we start from

Four sections are enough to start:

Five traps we hit

FAQ

Can I check which rules the assistant loaded? Yes. The /memory command in a conversation shows the rules files in use and lets you open them for editing.

What if the assistant breaks a rule? Most often the rule is too vague or got lost in a long file. Shorten it to one concrete sentence and move it higher.

Install this as a skill (one line in a terminal, from our plugin marketplace on GitHub):

claude plugin marketplace add MokebeGluszak/bolekrobot-skills; claude plugin install rules-file-writer-en@bolekrobot

Preview SKILL.md. A skill is a single instructions file - nothing to execute.