Tutorials · Beginner
CLAUDE.md: teach Claude to work the way you want
A CLAUDE.md file gives Claude Code context and rules in every project. Learn what to put in it, where it goes and why it saves you repeating yourself.
- Claude Code
CLAUDE.md is a text file where you leave Claude Code your project’s rules and information. Claude reads it automatically at the start, so you don’t have to repeat yourself in every conversation. Tap each block to open it.
What is it for?
Imagine hiring someone and having to explain EVERYTHING every morning. Exhausting, right? CLAUDE.md is that “handbook” Claude reads once and remembers: what your project is, which tools you use, your style, and what it should NOT do.
1 Create it
Easiest way: in Claude Code type the command /init and it creates a CLAUDE.md by analyzing your project. Or create it by hand: a file named CLAUDE.md in your project’s main folder.
2 What to put inside
Write it in plain language, as bullet points. For example:
# My project
- It's a personal website built with Astro.
- Site language: Spanish first, English second.
## How to work
- Explain changes in simple words before making them.
- Commit and push when something is done.
## Rules
- Never push passwords or keys to the repo.
- Don't install new libraries without asking me.
3 Keep it alive
Whenever you notice you’re repeating something to Claude (“remember to…”), add it to CLAUDE.md. Over time it becomes your project’s memory and Claude works more and more your way.
Quick tips
- Short and clear beats long and vague.
- Write rules, not essays: short bullets.
- Commit it to GitHub: that way it travels with your project.
- Something applies to ALL your projects? Put it in the
CLAUDE.mdin your home folder (global).