Instructions That Load Every Time
On Monday, Leila tells her agent that the monthly reports live in the reports/ folder, that numbers are always written with a comma for thousands, and that it must never touch the archive/ folder. It does a good job. On Tuesday she starts a new session, and it searches the whole computer for the reports, writes 12500, and suggests tidying up archive/.
Nothing went wrong. The agent simply never knew.
Leila I explained all of that yesterday. Why doesn't it learn my project?
Omid Think back to how a model works. When does it learn anything?
Leila During training. After that, the numbers stay the same. And between requests it keeps nothing, because the model is stateless.
Omid So on Tuesday, what does it know about your project?
Leila Only what's in Tuesday's context. Which is my new message, and the app's own instructions.
Omid Right. So if you want it to know something in every session, what has to happen?
Leila Someone has to put it into the context every time. I could paste the same paragraph at the start of each session... but I'd forget, and it's boring.
Omid So let the program do the pasting. You write the paragraph once, in a file. At the start of every session, the harness reads the file and puts it into the context, near the system prompt. The model sees it before your first message, every time.
Leila So it doesn't learn my project. It's told about it, fresh, every morning.
Omid Exactly. And because you wrote it down, it's told the same thing every morning.
Instruction files
An instruction file is a plain text file of notes about a project that the agent's program reads at the start of every session and adds to the context. The model never "learns" it; it reads it again, every session.
In Claude Code the file is called CLAUDE.md (.md means it's written in Markdown, plain text with a few marks like # for headings). There are a few places it can live:
~/.claude/CLAUDE.md, in your own home folder: your personal notes, loaded in every project. ("Explain things simply. I use British spelling.")CLAUDE.mdin the project's folder: notes about this project. Teams usually keep it with the project's files, so everyone's agent gets the same notes.CLAUDE.mdin a subfolder: loaded only the first time the agent works with files in that folder, so its notes don't cost anything until they're relevant.
Many other agents (Codex, Cursor, Gemini CLI and more) read a file called AGENTS.md, an open format meant to work for any agent. Claude Code reads AGENTS.md when a project has no CLAUDE.md, and a CLAUDE.md can include another file with a line like @AGENTS.md, so one set of notes can serve every agent.
Here is Leila's, after a week:
# Monthly reports
- Reports are in reports/YYYY-MM/. Templates are in templates/.
- Write numbers with a comma for thousands: 12,500, not 12500.
- Never change anything in archive/. It is the legal record.
- Run `python check_report.py <file>` after editing a report.
- Charts use the brand colours in templates/colours.md.Five lines, and each one would otherwise cost her a correction. Notice what they have in common: they are specific (a folder, a command, an example) and true every session.
What to put in, and what to leave out
Every line of an instruction file is sent in every request of every session. That makes it powerful, and it makes it expensive. Three things follow.
It costs tokens. A 2,000-line file rides along in every request, whether the task needs it or not. (A later lesson shows how text that repeats at the start of every request gets cheaper, but the space in the context window is still taken.)
It competes for attention. Remember what happens in a crowded context: the more there is, the easier it is for one line to be overlooked. Ten sharp lines are followed more reliably than three hundred loose ones. Claude Code's documentation suggests keeping each file under about 200 lines.
It's guidance, not a lock. The model reads the file the way it reads everything: as text that strongly shapes what it does, usually. If something must happen every time, without exception, a later lesson shows a tool that doesn't depend on the model remembering.
So, in: the commands to build, test or check things; where things are; the house rules and conventions; the mistakes the agent keeps making. Out: long documents (link to them instead: "the brand guide is in docs/brand.md"), things that change every week, and general advice the model already follows ("write clean code").
In Claude Code, /init asks the agent to look around a project and write a first CLAUDE.md for you, and /memory opens your instruction files to edit. Edits to the main file take effect from the next session (or after /clear).
Try it
If you have an agent, open a project folder and ask it: "What do you know about this project before reading any files?" Then add a CLAUDE.md (or AGENTS.md) with three specific lines, start a new session, and ask again. With a chat assistant, look for its "custom instructions" or "project instructions" setting: it's the same idea.
Using it well
- Add a line the second time you correct the agent. Once is a slip; twice is a missing instruction.
- Write lines you could check. "Use the template in templates/report.md" can be followed and checked; "make it look professional" can't.
- Keep it short and prune it. Read it once a month and delete what's no longer true. A wrong line is followed as faithfully as a right one.
- Point to long documents rather than pasting them. The agent can open a file when it needs it; it can't un-read one you forced into every request.
Words to know
- instruction file - a text file of notes about a project that an agent's program reads at the start of every session and puts into the context
- CLAUDE.md - Claude Code's instruction file, kept in your home folder, a project's folder or a subfolder
- AGENTS.md - an open format for instruction files, read by many different agents
Big idea
An agent doesn't learn your project; it's told about it, fresh, at the start of every session. An instruction file is how you tell it once and have it told every time. Keep it short, specific and true, because every line is read in every request.