Guide · work calls
Claude Code memory and CLAUDE.md best practices
Claude Code starts every session with a fresh context. What carries over between sessions is its memory: the CLAUDE.md files you write and the auto memory notes Claude writes for itself. This guide sums up how both work and how to write a CLAUDE.md that stays useful.
Checked against Anthropic's Claude Code documentation (How Claude remembers your project) on 25 November 2026 · tested with Claude Code and Codex
Claude Code changes often. If something here differs from the docs, the docs win.
Two kinds of memory
| CLAUDE.md files | Auto memory | |
|---|---|---|
| Who writes it | You | Claude |
| What it holds | Instructions and rules | Learnings and patterns |
| When it loads | Every session | When auto memory is on: the first 200 lines or 25KB of MEMORY.md, whichever comes first |
Source: CLAUDE.md vs auto memory.
Both are context, not enforced configuration: Claude reads them and tries to follow them. For something that must happen every time, the docs point to hooks instead. Source.
Where CLAUDE.md files live
| Scope | Location | Shared with |
|---|---|---|
| Managed policy | An OS-level path set by IT (for example /Library/Application Support/ClaudeCode/CLAUDE.md on macOS) | Everyone in the organization |
| User | ~/.claude/CLAUDE.md | Only you, all projects |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md | The team, through source control |
| Local | ./CLAUDE.local.md (add it to .gitignore) | Only you, this project |
Source: Choose where to put CLAUDE.md files.
- Loading: Claude Code loads CLAUDE.md and CLAUDE.local.md from the working directory and every directory above it, at launch. Files in subdirectories load on demand, when Claude works with files there. Source.
- Order: files are concatenated, not overridden. Content runs from the filesystem root down to the working directory, and in each directory CLAUDE.local.md comes after CLAUDE.md. Source.
- Rules: for larger projects, topic files go in .claude/rules/. A rule with a
pathsfield in its frontmatter loads only when Claude works with matching files. Personal rules for every project go in ~/.claude/rules/. Source. - AGENTS.md: Claude Code reads an AGENTS.md when there is no CLAUDE.md or CLAUDE.local.md in the working directory or above it; by default, if both exist, it reads the CLAUDE.md files. To share one file with other tools, put
@AGENTS.mdin a CLAUDE.md next to it. Source.
Imports
A CLAUDE.md can pull in other files with @path/to/file. Relative paths resolve from the file that contains the import, not the working directory. Imported files can import others, up to four hops deep. Imports inside code spans and code blocks are ignored. The first time a project imports files from outside the working directory, Claude Code asks you to approve them. Source.
Imports help organize a long file but don't make it cheaper: imported files load together with the CLAUDE.md that imports them. Source.
Auto memory and /memory
- What it is: notes Claude saves for itself across sessions, such as your preferences and corrections you give it. It skips what it can derive from the code or what CLAUDE.md already says. Source.
- Where: ~/.claude/projects/<project>/memory/, with a MEMORY.md index and topic files. All worktrees and subdirectories of one git repository share it, and it stays on your machine. Source.
- On or off: on by default in local sessions. Toggle it in
/memory, setautoMemoryEnabledin settings, or setCLAUDE_CODE_DISABLE_AUTO_MEMORY=1. Source. - /memory: lists your CLAUDE.md, CLAUDE.local.md and other memory files, opens them in your editor, toggles auto memory and opens the auto memory folder. Everything there is plain markdown you can edit or delete. Source.
- "Remember this": asking Claude to remember something saves it to auto memory; to put it in CLAUDE.md, say "add this to CLAUDE.md" or edit the file yourself. Source.
- /init generates a starting CLAUDE.md from your codebase, and suggests improvements if one already exists. Source.
CLAUDE.md best practices
- Keep it short. The docs suggest under 200 lines per CLAUDE.md file; longer files use more context and reduce adherence. Source.
- Write what Claude can't discover: build and test commands, conventions, project layout, "always do X" rules. Add an entry when Claude repeats a mistake or you type the same correction twice. Source.
- Be concrete enough to check. "Run npm test before committing", not "test your changes". Source.
- Move the rest out. Multi-step procedures go into skills; instructions for one part of the codebase go into path-scoped rules. Source.
- Remove contradictions. If two instructions conflict, Claude may pick one arbitrarily; review your files periodically. Source.
- Don't paste docs. Link or import the one file that matters instead of copying a manual in; a copy goes stale and costs context every session. (Our advice, in line with the size guidance above.)
- Check what loaded. If Claude ignores an instruction, run
/context alland look under Memory files. Source.
To make your instruction files also answer questions on work calls (exact values with sources, decisions with reasons), see Make your CLAUDE.md / AGENTS.md answer questions on calls; this page stays general.
On calls
Your agent's memory knows the project; on a status call you are the one being asked. Have Claude Code or Codex keep the facts you get asked about in a facts file next to CLAUDE.md. FlexQ listens to the call on your computer and shows a short cue from your project folder when someone asks you a question; the facts come from a file your coding agent keeps (project facts file template). See the AI meeting assistant or FlexQ for work calls.
Download FlexQ for macOS or Windows. How it handles your files is set out in the privacy policy.
FAQ
Where is Claude Code memory stored?
CLAUDE.md files live in your project (./CLAUDE.md or ./.claude/CLAUDE.md), in ~/.claude/CLAUDE.md for all your projects, and in ./CLAUDE.local.md for personal project notes. Auto memory lives in ~/.claude/projects/<project>/memory/ on your machine. Source: Anthropic's Claude Code docs, checked 25 November 2026.
What is the difference between CLAUDE.md and auto memory?
You write CLAUDE.md: instructions and rules loaded every session. Claude writes auto memory: notes about your preferences and corrections, loaded when auto memory is on.
How long should a CLAUDE.md be?
Anthropic's docs suggest under 200 lines per file. Move procedures into skills and part-specific instructions into path-scoped rules in .claude/rules/.
How do imports work in CLAUDE.md?
Write @path/to/file anywhere in the file. Relative paths resolve from the importing file, imports can nest up to four hops, and imported files still count toward context.
Does Claude Code read AGENTS.md?
Yes, when there is no CLAUDE.md or CLAUDE.local.md in the working directory or above it. If you have both, add @AGENTS.md to your CLAUDE.md to share one file with other tools.
More
FlexQ for work calls · AI meeting assistant for work calls · CLAUDE.md / AGENTS.md guide · Project facts file template · All guides · Download FlexQ