Skill · Claude Code Documentation
Embed Project Rules in Claude.md Files
Photo: Matilda Alloway on Unsplash
Stop repeating coding standards every session. Create a CLAUDE.md file at your project root and Claude Code automatically loads your project's architecture, build commands, and coding style at launch. This persistent memory persists across all developer sessions without eating into your token window.
Claude Code's CLAUDE.md system lets you bake project-specific instructions directly into your repository. Instead of briefing Claude on your tech stack, naming conventions, and build procedures every time you start a new session, you create a simple markdown file that Claude reads automatically.
To get started, run the /init command in Claude Code. This analyzes your existing codebase and generates a starter CLAUDE.md with relevant context. You can then edit this file to include: build and test commands, coding standards, architectural decisions, folder structure, and naming conventions. Store it at the root as ./CLAUDE.md and commit it to version control - your entire team benefits from the same context.
The file lives in the repository and syncs through git, so every developer working on the project (and Claude Code itself) receives the same instructions. Claude loads CLAUDE.md files from your working directory and all parent directories, concatenating them in order, so you can layer project-wide rules with team-wide rules with personal preferences.
For example, if you're working on a TypeScript/React project, your CLAUDE.md might specify: "Always use TypeScript strict mode, write unit tests with Vitest before implementation, follow the folder structure in ./docs/architecture.md, and use conventional commit messages." Once saved, Claude Code loads this on every session without repeating instructions.
Keep the file under 300 lines - Claude reads it at the start of every session and tokens matter. Focus on high-impact standards rather than verbose explanations.
Sources & credits
Original source: Claude Code Documentation