Skip to content

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.

CLAUDE.md
# 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 }` shape

A 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.

Question 1Who writes auto memory?

Question 2What is the recommended size limit for CLAUDE.md?

Question 3Global vs project CLAUDE.md — which wins on conflict?