What a session reads
Root guidance.AGENTS.md and CLAUDE.md at the root of the repository are the agent’s standing instructions from the first message.
The agent follows them without having to open the file.
Guidance in a directory.
An AGENTS.md or CLAUDE.md in a subdirectory, such as services/billing/AGENTS.md, is added when the agent first reads or edits a file in that directory, and applies only there.
Commands the agent runs in that directory do not add it, so an agent that only runs commands there is not given that guidance.
Work in another directory is not affected by it.
The session shows a line when it joins: “Following services/billing/AGENTS.md for work in services/billing/”.
The first change the agent makes to a file in such a directory is held for a moment so that it is made following that guidance.
Guidance is read from at most 64 directories; a repository with more has the rest left out, and the session and settings name them.
Skills.
A skill is a folder with a SKILL.md, in .claude/skills/<name>/ or .agents/skills/<name>/.
Its first lines say what it is called and when to use it.
.claude/skills/ come before those in .agents/skills/.
At most 50 skills are listed, and a SKILL.md larger than 64 KB is skipped.
A description longer than 1,024 characters is cut at that length.
Skill names and descriptions together are limited to about 16 KB, and the text of all listed skills to about 512 KB; a skill that would pass either limit is skipped.
A skill the reading did not get to open, because it ran out of time or of file reads, is named as not read.
A very large repository, or a slow GitHub, can stop a session from seeing every file.
When GitHub cuts its list of files short, or reading takes longer than a few seconds, the session and the project’s settings say that some guidance was not read, rather than that none was found.
A repository with none of these files behaves exactly as it did before.
Imports
A line that holds only@ and a path, such as @AGENTS.md, imports that file.
The path is relative to the file that names it, and it must point to a Markdown file inside the repository.
The line itself is not shown to the agent; the imported file’s content is included once, even when two files import each other.
A CLAUDE.md that holds only @AGENTS.md therefore gives the agent the content of AGENTS.md.
Imports are followed up to three files deep.
An import of a file that does not exist is not followed, and the project’s settings list it as not found.
Two kinds of @ line are not imports, and the agent receives them as written:
- a line inside a code fence, such as an example of the syntax in a fenced block
- a line whose path has a space in it, or is longer than 256 characters
CLAUDE.md linked to AGENTS.md, is listed, but its text is given to the agent once.
Only what is committed on the default branch
A session starts from one commit of your default branch, and it reads guidance as committed there. That commit is shown at the start of the session.- Guidance that exists only on another branch, or only as an uncommitted change, is not read.
- A change the agent makes to
AGENTS.md,CLAUDE.mdor a skill during the session does not change what it follows in that session, including a newAGENTS.mdin a directory it then works in. - A change you merge while a session is running is followed from the next session you start.
What guidance cannot change
Guidance steers how the agent works. It does not change what the agent is allowed to do.- The sandbox, and what it can reach, stay as they are. Only the hosts your admins have approved are reachable, and guidance cannot add one.
- The agent cannot push to your repository, and guidance cannot give it a way to.
- You decide whether the agent’s work is published as a pull request. Guidance cannot take that decision away.
The 32 KB limit
A session takes about 32 KB of guidance files in all, counting root and directory files together.- Root files come first, in this order:
AGENTS.md,CLAUDE.md, then what they import. - Guidance in directories is added after, nearest the root first, as long as a directory’s files fit whole. A directory that does not fit is left out entirely, and the agent never reads it as guidance in that session. Directories past the first 64 that have guidance are left out too, and so is a directory with a file over 1 MB or one that could not be read.
- If the root files do not all fit, the first one that does not fit in what is left is cut short where the limit ends, and every root file after it is not used. Every directory is then left out. A 20 KB
AGENTS.mdfollowed by a 20 KBCLAUDE.mdtherefore gives the agent all ofAGENTS.mdand about 12 KB ofCLAUDE.md, and both the session and settings sayCLAUDE.mdis cut short, although neither file is over 32 KB.