ENFR
8news

Tech • IA • Crypto

TodayAll videosAll topicsTop articles 24hArchives

The CLAUDE.md File

AnthropicClaudeMay 10, 2026 at 03:28 PM2:57
0:00 / 0:00

TL;DR

A structured claw.md file provides persistent context that significantly improves code generation accuracy and consistency across development sessions.

KEY POINTS

Persistent project memory

The claw.md file acts as a built-in memory layer for development environments, allowing tools like Claude Code to retain key project details across sessions. Without it, systems must repeatedly analyze the codebase, infer dependencies, and guess conventions, increasing the likelihood of errors and inefficiencies.

Automatic context injection

Stored at the root of a project, claw.md is automatically read at session startup and appended to prompts. This effectively functions as an onboarding script, giving immediate awareness of the project’s structure, tooling, and expectations without requiring manual explanation each time.

Capturing stack and conventions

Typical entries include frameworks such as Next.js 15, styling systems like Tailwind, database tools like Drizzle ORM, and coding standards such as two-space indentation or named exports. It can also define architectural rules, including preferring server actions over API routes or specifying folder structures.

Improved code generation quality

With predefined context, generated code aligns more closely with project standards from the outset. For example, component generation automatically follows the correct styling framework and structure, reducing the need for corrections and rework.

Team-wide and personal layers

A hierarchy of configuration exists: a shared project-level claw.md for team consistency, and a user-level version for individual preferences. Personal files can store habits like comment style, while project files enforce shared conventions.

Adaptive memory updates

Developers can refine behavior over time by explicitly saving corrections into memory. If recurring adjustments are needed, adding them to claw.md ensures they persist across future sessions, improving long-term efficiency.

Referencing documentation

The system supports linking internal documentation using file path references, enabling direct access to project-specific guidelines and reducing ambiguity in implementation decisions.

Minimalist, iterative approach

Experts recommend starting without a claw.md file to identify recurring friction points. This allows teams to build a concise, high-value configuration focused only on necessary guidance rather than overloading it with redundant information.

CONCLUSION

A well-maintained claw.md file transforms coding workflows by embedding context directly into the development process, reducing friction and enabling more accurate, consistent outputs.

Full transcript

One of the most useful parts of claw code is the claw.md file. It gives cloud code persistent memory about your project. When you open up cloud code without a cloud.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 claw.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 claw.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 claw.md that lives in the root directory of your project. You have a user level claw.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 claw.md file so you can see where you have to constantly course correct the model. This keeps your claw.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.

More from Anthropic