Anthropic / Claude Code8 minLesson 6 of 60

CLAUDE.md: Your Project's Memory

A CLAUDE.md file is project memory the agent reads on every turn. It is where you write down the things you would otherwise repeat in every session: how to run tests, what conventions to follow, which directories are off limits.

What belongs in it

  • Build and test commands the agent should use.
  • Code style and architecture conventions specific to this repo.
  • Known gotchas ("the API client retries, do not add your own").
  • What not to touch (generated files, vendored code).
Keep it tight
This file loads every turn, so it spends your context budget. Keep it to durable, high-value facts. A bloated memory file quietly degrades every session.
CLAUDE.md
# Project: payments-api

## Commands
- Test: `npm test`
- Type check: `npm run typecheck`

## Conventions
- No `any`. Prefer discriminated unions.
- All money is integer cents, never floats.

## Do not touch
- `src/generated/**` is codegen output.

The same idea works under the open AGENTS.md name, which many other agents read too. Pick whichever your tools support and keep it lean.

Manage Claude's memory (docs)How CLAUDE.md memory files are discovered, layered, and loaded.code.claude.com
Finished this lesson? Mark it read to track your progress.