Best AI Code Tools

CLAUDE.md: what it is and how to write one

Updated Oct 26, 2026 · Sources listed at the end

CLAUDE.md is a Markdown file of instructions that Claude Code loads at the start of every session, so it knows your build and test commands, coding standards and conventions without being told each time.1 Each session starts with a fresh context window; CLAUDE.md (plus Claude’s own “auto memory”) is how knowledge carries over.1

Where to put it

FileUseShared with
~/.claude/CLAUDE.mdPersonal preferences for all projectsOnly you
./CLAUDE.md or ./.claude/CLAUDE.mdProject architecture, standards, workflowsYour team via source control
./CLAUDE.local.mdPersonal, project-specific notes (add to .gitignore)Only you

Source: Claude Code memory docs.1

Getting started

Run /init and Claude analyses the codebase and writes a starting CLAUDE.md with build commands, test instructions and conventions it finds; if one exists, it suggests improvements instead of overwriting.1 Run /context to confirm it loaded.1

Writing tips from the docs

CLAUDE.md and AGENTS.md

Claude Code can read a repository’s AGENTS.md in place of CLAUDE.md, but by default only when there is no CLAUDE.md in the working directory or above it.1

Footnotes

  1. Claude Code docs, How Claude remembers your project. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7

Tools mentioned

Sources

  1. Claude Code docs: How Claude remembers your project (CLAUDE.md)

Related lists

Related comparisons and alternatives

Related guides