CLAUDE.mdprovides Claude Code with persistent project memory, acting as an onboarding script for your codebase that improves its understanding and performance.- This Markdown file, placed at your project's root, automatically appends its contents to your Claude prompts, giving crucial context about your stack, preferences, and commands.
- Effective use of
CLAUDE.mdsignificantly reduces the need for constant course correction, leading to more productive Claude Code sessions.
The CLAUDE.md file
- The
CLAUDE.mdfile is a Markdown document placed in your project's root directory, providing Claude Code with persistent context about your codebase. - It acts as an "onboarding script" for Claude, automatically appending its contents to your prompts to inform the AI about your project's tech stack, code style, and architectural preferences.
- Use the
/initcommand in Claude Code to generate an initialCLAUDE.mdfile based on your existing codebase. - Share
CLAUDE.mdin your version control system to ensure consistent Claude Code behavior across your development team. - There's a memory file hierarchy: a project-level
CLAUDE.md(in the root) for project specifics and a user-levelCLAUDE.md(in your configuration folder) for personal preferences that apply across all projects. - To incorporate project documentation, use the
@symbol followed by the file path withinCLAUDE.mdto allow Claude to reference specific documents. - Start new projects without a
CLAUDE.mdinitially; add information only for areas where you consistently need to correct Claude, keeping the file concise and focused on essential context. - Populate
CLAUDE.mdwith your stack details, personal preferences (e.g., indentation, named exports), and common commands.
CLAUDE.md— A Markdown file providing persistent context and memory to Claude Code about a specific project.Claude Code— An AI coding assistant that uses context to understand and interact with your codebase.persistent memory— The ability of an AI to retain and recall information about a project or user preferences across different sessions.app router— A routing paradigm in Next.js 13+ that enables features like Server Components and nested layouts.Tailwind— A utility-first CSS framework for rapidly building custom user interfaces.Drizzle ORM— A type-safe, performant Object-Relational Mapper for TypeScript, often used with databases.named exports— A JavaScript module export type where specific functions, objects, or variables are exported by their name.API routes— Server-side endpoints created within a Next.js application, typically for handling data fetching or form submissions.server actions— Functions in Next.js that that run directly on the server, often used to mutate data or handle form submissions without explicit API routes.version control— A system that records changes to a file or set of files over time, allowing for collaboration and reverting to previous versions (e.g., Git).
One of the most useful parts of claw code is the CLAUDE.md file. It gives Claude Code persistent memory about your project. When you open up Claude Code without a CLAUDE.md file, it's like it has to start fresh every single time. It has to reexplore your codebase, understand what dependencies are needed and the features that are already implemented. Sometimes it has to make assumptions which makes it harder for us to steer claude in the right direction. But that's where CLAUDE.md comes in. It's a markdown file that you add to the root of your project and claude code reads it automatically every time you start a session. It's like an onboarding script for your codebase. Simply put, the contents of CLAUDE.md file are appended to your own prompt. You can run the /init command which will make claw generate one based off of your codebase. So let's have a look at one. This is a Nex.js15 app using the app router Tailwind and Drizzle OM command dev server run test lint code style use two space indentation prefer named exports all API routes go in app/ API use server actions instead of API routes where possible and it's pretty straightforward. Now, if I ask Claw Code to create a React component, it knows how to style it with Tailwind or any other CSS framework that I'm using, we can see that Claw does a better job at doing its job right off the bat versus having to understand where everything is at first. And before you ask, the answer is yes. You share this in your version control for your team to use, but there's actually a hierarchy of memory files depending on who it's for. So, first you have your project level CLAUDE.md that lives in the root directory of your project. You have a user level CLAUDE.md that lives in your configuration folder. This one is just for you and goes across all your projects. So, put your personal preferences here like how you write code comments. First, if you have to correct Claude to do something like always use server actions instead of API routes, then explicitly ask Claude to save this to memory so that when you come back to this project, it will know every single time. Second, if you have docs in your project that you want claw to reference, just use the at symbol with the file path. And third is we recommend you start off a project without a CLAUDE.md file so you can see where you have to constantly course correct the model. This keeps your CLAUDE.md file compact and contain only the necessary information that clock can work with. The difference between a frustrating clock code session and a productive one comes down to the context and the clot.md file is how you provide that context. Start with your stack, your preferences and then commands and just build from there as you go.
TL;DR
CLAUDE.mdprovides Claude Code with persistent project memory, acting as an onboarding script for your codebase that improves its understanding and performance.- This Markdown file, placed at your project's root, automatically appends its contents to your Claude prompts, giving crucial context about your stack, preferences, and commands.
- Effective use of
CLAUDE.mdsignificantly reduces the need for constant course correction, leading to more productive Claude Code sessions.
Takeaways
- The
CLAUDE.mdfile is a Markdown document placed in your project's root directory, providing Claude Code with persistent context about your codebase. - It acts as an "onboarding script" for Claude, automatically appending its contents to your prompts to inform the AI about your project's tech stack, code style, and architectural preferences.
- Use the
/initcommand in Claude Code to generate an initialCLAUDE.mdfile based on your existing codebase. - Share
CLAUDE.mdin your version control system to ensure consistent Claude Code behavior across your development team. - There's a memory file hierarchy: a project-level
CLAUDE.md(in the root) for project specifics and a user-levelCLAUDE.md(in your configuration folder) for personal preferences that apply across all projects. - To incorporate project documentation, use the
@symbol followed by the file path withinCLAUDE.mdto allow Claude to reference specific documents. - Start new projects without a
CLAUDE.mdinitially; add information only for areas where you consistently need to correct Claude, keeping the file concise and focused on essential context. - Populate
CLAUDE.mdwith your stack details, personal preferences (e.g., indentation, named exports), and common commands.
Vocabulary
CLAUDE.md— A Markdown file providing persistent context and memory to Claude Code about a specific project.Claude Code— An AI coding assistant that uses context to understand and interact with your codebase.persistent memory— The ability of an AI to retain and recall information about a project or user preferences across different sessions.app router— A routing paradigm in Next.js 13+ that enables features like Server Components and nested layouts.Tailwind— A utility-first CSS framework for rapidly building custom user interfaces.Drizzle ORM— A type-safe, performant Object-Relational Mapper for TypeScript, often used with databases.named exports— A JavaScript module export type where specific functions, objects, or variables are exported by their name.API routes— Server-side endpoints created within a Next.js application, typically for handling data fetching or form submissions.server actions— Functions in Next.js that that run directly on the server, often used to mutate data or handle form submissions without explicit API routes.version control— A system that records changes to a file or set of files over time, allowing for collaboration and reverting to previous versions (e.g., Git).
Transcript
One of the most useful parts of claw code is the CLAUDE.md file. It gives Claude Code persistent memory about your project. When you open up Claude Code without a CLAUDE.md file, it's like it has to start fresh every single time. It has to reexplore your codebase, understand what dependencies are needed and the features that are already implemented. Sometimes it has to make assumptions which makes it harder for us to steer claude in the right direction. But that's where CLAUDE.md comes in. It's a markdown file that you add to the root of your project and claude code reads it automatically every time you start a session. It's like an onboarding script for your codebase. Simply put, the contents of CLAUDE.md file are appended to your own prompt. You can run the /init command which will make claw generate one based off of your codebase. So let's have a look at one. This is a Nex.js15 app using the app router Tailwind and Drizzle OM command dev server run test lint code style use two space indentation prefer named exports all API routes go in app/ API use server actions instead of API routes where possible and it's pretty straightforward. Now, if I ask Claw Code to create a React component, it knows how to style it with Tailwind or any other CSS framework that I'm using, we can see that Claw does a better job at doing its job right off the bat versus having to understand where everything is at first. And before you ask, the answer is yes. You share this in your version control for your team to use, but there's actually a hierarchy of memory files depending on who it's for. So, first you have your project level CLAUDE.md that lives in the root directory of your project. You have a user level CLAUDE.md that lives in your configuration folder. This one is just for you and goes across all your projects. So, put your personal preferences here like how you write code comments. First, if you have to correct Claude to do something like always use server actions instead of API routes, then explicitly ask Claude to save this to memory so that when you come back to this project, it will know every single time. Second, if you have docs in your project that you want claw to reference, just use the at symbol with the file path. And third is we recommend you start off a project without a CLAUDE.md file so you can see where you have to constantly course correct the model. This keeps your CLAUDE.md file compact and contain only the necessary information that clock can work with. The difference between a frustrating clock code session and a productive one comes down to the context and the clot.md file is how you provide that context. Start with your stack, your preferences and then commands and just build from there as you go.