The file the agent reads before doing anything
CLAUDE.md is a markdown file Claude Code loads automatically at the start of every session. Think of it as the first message you don't have to type. Anything that's true about your project for the long term — stack, architecture, commands, conventions, hard constraints — belongs here, not in the chat.
The hierarchy: ~/.claude/CLAUDE.md (your global preferences) → repo-root CLAUDE.md (team standards) → src/.../CLAUDE.md (subdirectory-specific rules). All matching files merge into the system prompt; closer-to-cwd files take precedence on conflict. That's how you give a payments service tighter rules than the rest of the repo without copy-paste.
Bootstrap with /init: it scans the project, reads package.json / pyproject.toml / framework configs, and drafts a starting CLAUDE.md. Then iterate. Mid-session, prefix any message with # and Claude appends that fact to the appropriate CLAUDE.md — no need to context-switch into your editor.