# What belongs in CLAUDE.md and AGENTS.md, and what does not

Canonical: [What belongs in CLAUDE.md and AGENTS.md, and what does not](https://contextingo.com/blog/what-to-put-in-claude-md-agents-md)

Locale: en

Purpose: Instruction files carry rules that stay true. A short list of what to include, what to leave out, and how to keep two files from drifting apart.

Content updated: 2026-09-23

Source revision: content.ts 2026-09-23

Maintenance owner: the Contextingo site owner

[Topic map](https://contextingo.com/llm/topics/blog.md) · [Complete scoped map](https://contextingo.com/sitemap.md)

Claude Code reads `CLAUDE.md` and Codex reads `AGENTS.md` at the start of a session. Both are useful for the same thing: rules that stay true for a long time.

## Include

- **Commands:** how to install, build, run tests and lint.
- **Layout:** where the main parts live, in a few lines.
- **Conventions:** naming, formatting, error handling, where tests go.
- **Boundaries:** folders and files the agent must not edit, such as generated code.
- **Review rules:** what a change needs before it is submitted.

## Leave out

- **Today’s findings and failed attempts.** They change daily and belong in records with a status.
- **Secrets** of any kind.
- **Long explanations** of history. A link to a decision record is enough.
- **Instructions copied from the web** you did not review.

## Keep two files in step

If the team uses both tools, keep the rules in one file and make the other point to it, or generate both from one source. The [comparison page](/compare/claude-md-agents-md) lists which file each tool reads.

## Review it like code

An instruction file steers every session. Change it through a pull request, and read it once a quarter to delete what is no longer true.

## Questions

### How long should the file be?

As short as it can be while holding the commands and rules an agent needs. Everything in it is read every session.

### Where do daily findings go?

Into project knowledge records, which the agent reads for the issue at hand. See [why coding agents forget](/blog/why-ai-coding-agents-forget).
