What Is The Claude File
Full Lesson Reference
What is the CLAUDE.md file?
Claude Code is an agent, not a chatbot. Agents work better when they know who they're working for, what the rules are, and what mistakes to avoid. That context goes in a file called CLAUDE.md.
This is the single highest-leverage setup decision you make. Get it right and every session starts warm - Claude knows your name, your locale, your conventions, your safety rules. Get it wrong (or skip it) and you'll repeat yourself every session until you do.
What CLAUDE.md actually is
CLAUDE.md is a plain text file that Claude Code reads automatically at the start of every session. You don't run it. You don't "invoke" it. It just gets loaded into the conversation as context before you type your first message.
Think of it as Claude's briefing document. Every time you start a session, Claude reads this file and uses it to calibrate how it responds.
Why it's your biggest leverage point
Everything you put in CLAUDE.md saves you typing forever. The alternative is retyping the same preferences into every session - your name, your voice, your safety rules, "use Australian English", "don't make up numbers", "commit messages start with Add/Fix/Update".
Skip CLAUDE.md and you'll
- Get generic responses calibrated for a generic user (not a marketer, not an Australian, not you)
- Correct the same mistakes every session
- Waste your opening messages on setup context instead of real work
- Get inconsistent output across sessions because there's no shared standard
Set it up once, maintained as you go, it pays back dividends forever.
The 3 levels of CLAUDE.md
CLAUDE.md files can live at 3 levels, and Claude reads all of them on every session:
Global CLAUDE.md
Lives at ~/.claude/CLAUDE.md on your computer. Applies to every Claude Code session you ever run. This is where your identity, work style, git conventions, and safety rails go - anything that applies everywhere.
Workspace / project CLAUDE.md
Lives inside a specific project folder (e.g. Claude
Code/my-first-pr oject/CLAUDE.md). Only loads when Claude is running inside that folder. This is where project-specific context goes - client name, brand colours, campaign goals, design system.
Sub-agent CLAUDE.md
Advanced. Rarely written by hand. When Claude Code dispatches a sub-agent to handle part of a task, that agent can have its own narrower context file. You won't need to worry about this early on - skills handle it for you.
The decisive test
For every line you're thinking of putting in a CLAUDE.md file, ask:
"Does this apply to every project I'll ever work on?"
- Yes - it goes in the global CLAUDE.md
- No, but applies to this one project - it goes in the project CLAUDE.md
- Claude already does this by default - delete it entirely, don't waste tokens
Size targets
Smaller is better. CLAUDE.md content is delivered to Claude on every single message in every single session. Long files dilute the important rules and waste tokens.
- Global CLAUDE.md: under 25 lines (ideal), under 50 (max)
- Project CLAUDE.md: 30-60 lines (more room for specifics)
If your global file is over 50 lines, there's almost certainly project-specific content hiding in it that should move.
Action items
☐ Understand: CLAUDE.md is loaded every session, applies forever once written
☐ Remember the 3 levels: global (you), project (this client), sub-agent (rare)
☐ Remember the decisive test: "does this apply to every project?"
☐ Remember the size targets: under 25 lines global, 30-60 project
Next lesson: Write your global CLAUDE.md.
Exercises
- Review the concepts covered in this lesson: What Is The Claude File.
- Write down your key takeaway from this lesson.
- Practice running any commands or prompts mentioned above inside your terminal.