Write your CLAUDE.md like a rulebook: the reading guide and three starter rules
The short version
Every AI chat tool reads a system prompt before it answers you: a block of hidden instructions, written by the company that makes the tool, that sets its tone, its limits and its habits. You never see it, but it's there at the start of every conversation. Think of it as the tool's rulebook. CLAUDE.md is the rulebook you get to write yourself. It's a plain text file that Claude Code reads at the start of every session, so whatever you put in it shapes every answer. Most people's first CLAUDE.md says something like "be helpful". That's why Claude Code rambles and creates files you never asked for: a vague rule gives it nothing to follow. A public GitHub folder, system-prompts-and-models-of-ai-tools by Lucas Valbuena (a 17-year-old in Spain, per his GitHub bio), collects what it says are the hidden rulebooks of many AI coding tools, Claude Code among them. It has 144,000+ stars. This guide uses one line from it to show the style, then gets you to write three rules of your own and points you to the copies Anthropic publishes itself. Source: Anthropic's Claude Code docs (https://code.claude.com/docs/en/memory) and the repo on GitHub, checked 23 Oct 2026.
| What | The number |
|---|---|
| Stars on the repo | 144,188 (checked 23 Oct 2026) |
| Lines from it you need | 1, claimed: "Keep your responses short" |
| Rules in your starter CLAUDE.md | 3 to start, 6 in the example |
| Anthropic's target size per CLAUDE.md | under 200 lines |
| Leaked text to copy | 0 |
Where CLAUDE.md lives
Anthropic's docs list the places Claude Code looks. The two you need in week one:
- Your project:
CLAUDE.mdin the project's top folder (or.claude/CLAUDE.md). Rules for this project only. If you share the project with a team through git, they get these rules too. - Just you, every project:
~/.claude/CLAUDE.md(the.claudefolder in your home folder). Your personal habits, used everywhere.
Both load when a session starts and are combined, not swapped: the project file is read after your personal one. Not sure
where to start? Type /init in Claude Code and it writes a first CLAUDE.md from your code; then edit it. To check what
loaded, type /context and look under Memory files.
The one line from the reel (claimed, not confirmed)
The repo's file for Claude Code (Anthropic/Claude Code/Prompt.txt) includes this instruction:
Keep your responses short
Treat it as claimed. Anthropic hasn't confirmed that file is real or current, and nobody can check that from outside. We quote only those four words, and only to show the style: short, blunt, one job per line. No "try to", no "where possible". That's the part worth copying. Not the text.
Write three rules of your own
Anthropic's own advice for CLAUDE.md says the same thing in plainer words: write instructions "concrete enough to verify", like "Use 2-space indentation" instead of "Format code properly", and keep each file under 200 lines. A good rule passes one test: could you look at Claude's answer and say yes or no, it followed it? Turn your vague line into three checkable ones:
- How long it talks. "Be helpful" → "Answer in four lines or fewer unless I ask for detail."
- When it stops and asks. "Be careful" → "Ask me before you delete or rename any file."
- What it's allowed to add. "Keep things tidy" → "Never create new files unless the task needs them. No notes or summary files."
A starter CLAUDE.md (copy this, then change it)
Written by us, in our own words. Paste it into CLAUDE.md in your project's top folder:
# How to work in this project
## Answers
- Answer in four lines or fewer unless I ask for detail.
- Show the change, then one line on why. No recap.
## Safety
- Ask me before you delete or rename any file.
- Never run git push. I push myself.
## Files
- Never create new files unless the task needs them.
- No notes, summary or README files I didn't ask for.
Six rules, three groups. Each one can be checked. Start with three, add one each time Claude does something you didn't want. Before: "be helpful." After: four-line answers, ask before deleting, no extra files. One line became three.
The legit place to learn: Anthropic's own prompts
Anthropic publishes the system prompts it uses for its Claude apps, officially, on a public page in its docs: https://platform.claude.com/docs/en/release-notes/system-prompts There's one entry per model, with dates. Its own description: the prompts used by claude.ai and the Claude iOS and Android apps; it also says these "do not apply to the Claude API". It doesn't cover Claude Code, but it's the real, confirmed thing, and it's the best way to see how a professional rulebook is written: what comes first, how rules are worded, how they say "never" and "ask first". Read one for 10 minutes before you write your own.
The catch
- The repo's files are leaked and unconfirmed. The companies didn't publish them. Nothing in the folder has been confirmed by the companies named, and the copies may be old or wrong.
- Pulling them out can break the apps' terms. Extracting a tool's hidden instructions is something some terms of service forbid (Cursor's, for example, bar attempts to "derive" the service's "underlying structure" or "extract data from the Service"). Don't try it yourself.
- Copy the style, never the text. Their wording belongs to someone else. Your CLAUDE.md should be your rules, in your words. Anthropic's published prompts are the clean place to study.
- CLAUDE.md guides Claude, it doesn't force it. Anthropic's docs: Claude treats it "as context, not enforced configuration". Short, specific rules are followed most reliably.
For builders
- Rules that only matter for part of the code can go in
.claude/rules/with apathsline, so they load only when Claude touches matching files (docs, "Path-specific rules"). CLAUDE.local.mdin the project's top folder holds personal project rules; add it to.gitignore.- If two rules contradict each other, Claude may pick one arbitrarily (docs). Read your file once a week and cut the stale lines.
Sources
- Anthropic, How Claude remembers your project (CLAUDE.md locations,
/init, writing tips, 200-line target): https://code.claude.com/docs/en/memory (checked 23 Oct 2026) - Anthropic, System prompts (official, per model): https://platform.claude.com/docs/en/release-notes/system-prompts (checked 23 Oct 2026)
- The repo: https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools (checked 23 Oct 2026; 144,188 stars; the quoted line is line 63 of
Anthropic/Claude Code/Prompt.txt; contents claimed, not confirmed by the companies) - Maker's GitHub profile (age and location from his bio): https://github.com/x1xhlol
- Cursor terms of service, section 1.5: https://cursor.com/terms-of-service