← All posts

Guides · Oct 30, 2026

What is CLAUDE.md?

CLAUDE.md is the file Claude Code reads first in every session. Where it lives, what goes in it, how long to keep it and what to move to other files.

Built by Simon + Claude

What Claude knows about your projectJanFebMarAprMayJunWithout CLAUDE.mdWith CLAUDE.md
What Claude knows about the project, with and without the file

TL;DR

  • CLAUDE.md is a markdown file of instructions that Claude Code reads at the start of every session, and you update it as the work changes.
  • It holds what Claude cannot work out from the folder. Keep each file under 200 lines, and point to longer instructions in other files.
  • Run /init and add the corrections you keep repeating. Each correction stays in place for every session after it.

In An agent in a folder we said that if you do only one thing, ask for a CLAUDE.md at the root of the folder. The question that follows in our bootcamps is what to put in it, and how much. This guide answers both.

What the file does

Each Claude Code session starts fresh, without what you told it in the last one. Anything Claude should know about your work, and cannot see by reading the folder, belongs in CLAUDE.md.

Monthly reportCLAUDE.mdholdings.csvsep-report.docxcharts.xlsxCLAUDE.mdNumbers from the fund system,not emailPercentages to one decimalThe committee meets on ThursdayNew session1Reads CLAUDE.md2Opens the files it needs3Starts on the reportThe folder shows what is thereCLAUDE.md says how you workClaude reads it firstin every new session
What Claude can see by itself, and what only you can tell it

Think of it as the note you would leave a capable colleague on their first morning.

Where the file lives

There can be more than one CLAUDE.md, and Claude Code reads them all (Anthropic, How Claude remembers your project).

OrganisationSet by IT on every machineYouYour preferences, every projectProjectShared with the team in gitSubfolderRules for one folder onlySession start1Managed CLAUDE.md2~/.claude/CLAUDE.md3./CLAUDE.md4reports/CLAUDE.mdwhen Claude opens files thereAll four are read. None replaces another.
Four CLAUDE.md files, in the order a session reads them

The project file at the root of the folder is the one the team shares, and the one this guide is mostly about. Your own file in ~/.claude/ holds preferences for every project, and IT can place an organisation file on every machine.

A CLAUDE.md in a subfolder is read when Claude works in that folder. Personal notes about one project go in CLAUDE.local.md. It is meant for you alone, so ask Claude to keep it out of the files the team shares.

In the Claude desktop app, the Code tab reads the same files. When you work in a local folder in Claude Cowork, Claude also reads a CLAUDE.md there, and the folder instructions in Customize do the same job.

What to put in it

Here is a CLAUDE.md for a folder where Claude helps produce a monthly report to an investment committee.

CLAUDE.md · Monthly portfolio report# Monthly portfolio reportThe monthly report to the investmentcommittee for Fund A, B and C.## Sources- Holdings in data/exports/holdings_YYYY-MM.csv- Last month's report is the template## Conventions- Returns in NOK, net of fees- Percentages to one decimal- Fund C in the EUR share class (decided 4 Mar)## Checks and limits- Holdings must add up to total NAV. Stop and ask if not- Never edit data/exports. Work on copies in work/## Where things are- @docs/report-style.mdloaded every session- docs/glossary.mdopened when needed123451What the folder is for2Sources3Conventions and decisions4Checks and limits5Where things are
A CLAUDE.md for a monthly report, with its five kinds of content

Write each line so it can be checked. "Percentages to one decimal" can be checked, while "Keep the numbers tidy" cannot. You do not have to write the file yourself. /init writes a quick first draft, and this prompt gives you our five headings.

You

Write a CLAUDE.md for this folder with five headings, what the folder is for, sources, conventions, checks and limits, and where things are. Ask me about anything you cannot see in the files.

How long it should be

Anthropic recommends keeping each CLAUDE.md under 200 lines. A longer file fills more of what Claude can keep in view during a session, and Claude follows it less reliably. When Claude keeps ignoring a rule, a long file is often the reason, and adding IMPORTANT or capital letters rarely helps.

The best way to improve the file is to ask Claude to do it. Claude can compare the file with the folder and point out what is unclear, out of date or contradictory, and what it could work out from the files.

You

Check whether CLAUDE.md is set up as well as it can be for what we work on in this folder.

CLAUDE.md · Monthly portfolio report1# Monthly portfolio report2## Where things are3- Reports are in reports/4- Holdings in data/exports5## Conventions6- Percentages to one decimal7- Fund C in the NOK share class8- Keep the numbers tidy9- Percentages to two decimals1234CLAUDE’S REVIEW1Claude sees this in the folder2Out of dateFund C moved to EUR in March3UnclearWhich numbers, and how?4Contradicts line 64 suggestionsYOUAccept
Claude reviews the file and marks four lines to change

Read the suggestions before you accept them. A line Claude wants to cut may be one only you know is true.

Point to the details in other files

CLAUDE.md does not have to hold everything. It can work as a map, with one line for each longer instruction kept elsewhere in the folder, saying when to read it.

CLAUDE.mdReport style:@docs/report-style.mdFund names and terms:docs/glossary.mdBefore handing over, runscripts/check-totals.pyLoaded every sessionreport-style.mdTEXTLead with what changedShort sentences, no jargonOpened when neededglossary.mdTEXTNAV, net asset valueFund C, EUR share classRun when neededcheck-totals.pyCODEfor fund in funds: check sum(holdings) == nav
CLAUDE.md points to longer instructions, in text and in code

A line can also point to a script, a small program Claude runs to check its own work, such as confirming that the tables add up. A script gives the same answer every time, as Deterministic and non-deterministic AI explains.

Put @ in front of a file name, as in @docs/report-style.md, and Claude reads that document in every session, so it counts towards the length. Without the @, the file stays out of the session until Claude reads it for a task.

Our own file for this website grew too long before we learned this. Now it holds a few hard rules and a table of where everything else lives.

You

Move the detailed instructions in CLAUDE.md into separate files. Leave one line in CLAUDE.md for each, saying when to read it.

CLAUDE.md, memory, skills and hooks

CLAUDE.md is one of four places where Claude Code keeps what it should know.

If the line is, it belongs inNeeded in every sessionCLAUDE.mdRead at the startPicked up along the wayAuto memoryWritten by Claude itselfNeeded for one kind of taskA skillLoaded when relevantMust happen every timeA hook or a settingEnforced by Claude Code
Where a line belongs

Auto memory is what Claude notes for itself, on your machine only. When you say "remember that I prefer tables to bullet points", the note goes there. When you say "add this to CLAUDE.md", it goes in the file the team shares.

Skills hold procedures that only matter for some tasks, such as the quarterly version of the report. A hook is a check that runs every time, whether or not Claude remembers the rule. You can ask Claude Code to write one for you.

You

Write a hook that blocks edits to the data/exports folder.

CLAUDE.md and AGENTS.md

Other AI coding tools, such as OpenAI's Codex, Cursor and most of GitHub Copilot's agent features, read their instructions from a file called AGENTS.md. If your team uses more than one tool, write the shared instructions once, in AGENTS.md.

CodexGitHub CopilotCursorMonthly reportAGENTS.mdShared instructionsReturns in NOK, net of feesCLAUDE.md@AGENTS.mdNotes for Claude onlyUse the house report styleClaude Code
One set of instructions, read by every tool

Add the line @AGENTS.md to CLAUDE.md, and Claude Code reads the shared file too. Anything that only concerns Claude goes below that line. If a folder has an AGENTS.md and no CLAUDE.md or CLAUDE.local.md, Claude Code reads the AGENTS.md on its own.

What changed with Opus 5.5

Some CLAUDE.md advice written for older models no longer holds. In Getting the most out of Opus 5.5, written by Addy Osmani and published by Anthropic, three of the tips apply to CLAUDE.md.

CLAUDE.md# Monthly portfolio reportReturns in NOK, net of fees.Think step by step beforeyou answer.Opus 5.5 decides how much to thinkWhen a step does not need me,keep going.Stop and ask before you deleteor overwrite anything.Name the stops you wantEnd every run with three headings,Blocked on me, Changed and Found.Say how the summary should look
One line out and three in, for Opus 5.5

Opus 5.5 always thinks before it replies and chooses how deeply, so lines that ask it to think can go. On a long task it sometimes stops to report instead of carrying on. Tell it when to stop and how the summary at the end should look.

You

Add a rule to CLAUDE.md. When a step does not need me, keep going. Stop and ask only when you cannot continue without me, or before you delete or overwrite anything.

We go through the whole guide in Anthropic's tips for working with Claude Opus 5.5.

How the file improves over time

Anthropic's rule of thumb is to add a line when Claude makes the same mistake twice, or when you type a correction you typed last session.

Corrections you typeJanFebMarAprMayNoneJunCLAUDE.md- Returns net of fees- Numbers from the fund system- Fund C in EUR from March- Open with what changed and why- Explain gaps over 2 points
Each correction is typed once and stays for every later report

The first lines are simple. In January you remind Claude that returns are net of fees, in February that numbers come from the fund system, not email, and in March that Fund C has moved to the EUR share class.

The later lines are about how you think. In April you ask Claude to open with what changed and why, and in May to use the holdings to explain any gap of more than two percentage points to the benchmark. By June the draft needs few corrections.

Share the file through git, so one person's correction helps the whole team, and date each decision so a later reader can see which rule is newer.

This is what we mean by AI capital, knowledge a team writes down once and keeps using.

Where to start

Open a folder you already work in and type /init in Claude Code. It writes a first draft, or suggests improvements if the file already exists.

Then add the two or three things you find yourself repeating.

Then end each working session with this prompt, and read the lines it adds, because a wrong line repeats itself in every session.

You

Add what we learned today to CLAUDE.md.

Monthly portfolio report

Add what we learned today to CLAUDE.md.

Added two lines under Conventions. They apply from the next session.CLAUDE.mdConventions+Name the benchmark in every return table (28 Oct)+Show fees on their own line in the summary (28 Oct)

Reply to Claude

Putting the session’s lessons into the file

When one part of the file turns into a procedure, move it into a skill, as described in Claude skills for you, your team and the company.