Home › Claude Code lesson 2: CLAUDE.md memory

Claude Code lesson 2: CLAUDE.md memory

Last checked

Each session starts fresh. CLAUDE.md files (which you write) and auto memory (notes Claude writes from your corrections) carry knowledge from one session to the next.

Step by step

  1. Create a CLAUDE.md file in your project with coding standards, test commands and how the project is laid out.
  2. Keep instructions short and specific; Anthropic says that makes Claude follow them more consistently.
  3. If the repository already has an AGENTS.md, Claude Code can read it instead.
  4. Put rules for particular file types in .claude/rules/.
  5. Let auto memory save your corrections and preferences, and review it from time to time.

Try it: examples

Good to know

Sources (official pages, read Nov 8, 2026)

Written from Anthropic's official documentation and product pages; we don't run hands-on tests. Features and limits vary by plan and country.

Report an error on this page