CLAUDE.md and Memory
Two ways Claude Code remembers your project across sessions, so you do not repeat yourself.
CLAUDE.md
A markdown file you write. Claude Code reads it at the start of every session. It holds the rules and facts you want it to always know.
Create one quickly:
/initThis scans your project and writes a starting CLAUDE.md for you.
Example content:
# Project Rules
- Run tests with `npm test`, not `npm run test:all`
- Use 2-space indentation
- Never edit files in /generated â they are auto-createdWhere It Can Live
| File | Scope |
|---|---|
~/.claude/CLAUDE.md | All your projects |
./CLAUDE.md | This project, shared with your team (commit it to git) |
./CLAUDE.local.md | This project, just for you (add to .gitignore) |
Keep it short and specific. âUse 2-space indentationâ is useful. âWrite good codeâ is not â Claude Code cannot act on advice that vague.
Auto Memory
Claude Code also learns on its own, without you writing anything. As it works, it saves things like âthis repo uses pnpm, not npmâ to a memory file for that project.
- It saves this automatically, as it works
- View or edit it with
/memory - It only affects this one project
CLAUDE.md is what you choose to tell it. Auto Memory is what it picks up along the way. Both load at the start of every session.
Next â Settings and Permissions