CLAUDE.md and auto memory
CLAUDE.md is a markdown file of project-specific instructions Claude reads at the start of every session: conventions, common commands, architectural context. Keep it under ~200 lines — longer files still load in full but may reduce adherence. Run /memory to open and edit it from within a session.
# Project conventions
## Commands- Build: `npm run build`- Test: `npm test`- Lint: `npm run lint`
## Stack- TypeScript with strict mode- React 19, functional components only
## Rules- Named exports, never default exports- Tests live next to source: `foo.ts` -> `foo.test.ts`- All API routes return `{ data, error }` shapeA global ~/.claude/CLAUDE.md holds personal preferences across every project (response style, commit format). Both load together; when instructions conflict, project-level takes priority.
Auto memory is different: Claude writes it itself. As it works, it saves build commands, debugging insights, and architecture notes to ~/.claude/projects/<project>/memory/. MEMORY.md is the index loaded each session; topic files like debugging.md are read on demand. It's on by default — toggle with /memory.
Check your understanding
Section titled “Check your understanding”Question 1Who writes auto memory?
Claude creates and updates MEMORY.md and topic files automatically; you can edit or delete them anytime.
Question 2What is the recommended size limit for CLAUDE.md?
Target under 200 lines; move overflow to skills or path-scoped rules.
Question 3Global vs project CLAUDE.md — which wins on conflict?
Both load together, but project-level instructions take priority on conflict.