mdpantry / CLAUDE.md starter
CLAUDE.md starter
Claude Code reads CLAUDE.md at the start of every session. This starter imports AGENTS.md with a single line, so Claude Code also reads the instructions written in your AGENTS.md, and keeps a short section for what only Claude Code needs.
Published . Updated .
The file
Email it to myself Download CLAUDE.md Open the raw file
2 blanks for you to fill
Or save it from a terminal:
curl -fsSL https://mdpantry.com/s/st_ayte7u4rzrr4puyh/raw -o CLAUDE.md
@AGENTS.md ## Claude Code Instructions for Claude Code only. Everything every agent needs lives in AGENTS.md, imported on the first line. - `<a workflow rule, for example: use plan mode for changes under src/billing/>` - `<a check to run before finishing, for example: npm run typecheck>` - Keep this file short: Claude Code reads it at the start of every session.
What goes in it?
Of 1,591 distinct CLAUDE.md files the registry has saved, from 2,099 public repositories, 41% have a commands section and 40% have an architecture section. Among the 132 in repositories with 1,000 stars or more, it is 46% and 45%. Testing comes in at 22%, and 6% have no section headings at all.
- Commands648 41%
- Architecture629 40%
- Rules576 36%
- Conventions564 35%
- Git and releases386 24%
- Overview358 23%
- Testing343 22%
- Configuration184 12%
- Stack152 10%
The 3 most common, as headings to paste and fill in:
## Commands ## Architecture ## Rules
178 of the 1,591 (11%) import AGENTS.md on a line of their own, as this starter does. With an AGENTS.md beside this file, put these sections in it, where every agent reads them, and keep here only what Claude Code alone needs. With none, delete the first line and write them here.
The words behind each count
- Commands:
command,build,script,install,setup,run,running,usage,quick start,getting started - Architecture:
architecture,structure,layout,directory,data flow,key files - Rules:
rule,important,never,avoid,constraint,gotcha,pitfall,critical,non negotiable - Conventions:
convention,style,standard,guideline,pattern,naming - Git and releases:
git,commit,branch,release,versioning,changelog,pull request - Overview:
overview,purpose,about,what this is,what this repo is,what this repository is,what this project is - Testing:
test,testing - Configuration:
environment,env,configuration,config,secret - Stack:
stack,technology,dependency,tech stack
Counted by the registry that serves this pantry, with no model in the count, from its saved copies as they stood on : 1,591 distinct files (identical files count once, so a template many repositories copy counts once). A section is a heading of one to three # signs outside a code block. A heading is in a group when it has one of that group's words, so one heading can be in two groups, and a file counts once per group. 1,079 of the 1,591 have at least one of the nine. Not live GitHub, and not every repository on GitHub, only the ones the registry has found.
Where does it go?
Claude Code reads CLAUDE.md from several places and adds every file it finds to the same context, none replacing another. Anthropic's memory documentation lists them in load order, broadest first:
| Whose | Where | Use it for |
|---|---|---|
| Everyone in an organization | a managed policy path set by IT | company standards and security rules |
| You, in every project | ~/.claude/CLAUDE.md | your own style and tool shortcuts |
| Your team, in this project | ./CLAUDE.md or ./.claude/CLAUDE.md | architecture, conventions and workflows, committed |
| Only you, in this project | ./CLAUDE.local.md | your sandbox URLs and test data, never committed |
Within one directory, the local file is added after CLAUDE.md, so your own notes are the last thing Claude reads there. Add the local file to your .gitignore so it is not committed:
CLAUDE.local.md
One catch with AGENTS.md. By default Claude Code reads an AGENTS.md only when there is no CLAUDE.md and no CLAUDE.local.md in the working directory or above it. A local file counts as a CLAUDE.md, so adding one to a project that relies on AGENTS.md stops Claude Code reading that AGENTS.md for you. Your ~/.claude/CLAUDE.md does not count.
Where real projects keep it, of 2,574 public repositories with a saved CLAUDE.md:
- The repository root
CLAUDE.md2,259 88% - A subdirectory
packages/web/CLAUDE.md648 25% - Inside .claude
.claude/CLAUDE.md110 4%
25 keep both a root file and one inside .claude. A repository counts in every place it has one, so the rows add to more than 2,574. Of 1,716 distinct root files, 32 name CLAUDE.local.md and 35 name ~/.claude/CLAUDE.md (2% and 2%): a project's committed file rarely points at the two personal ones.
Counted by the registry that serves this pantry, with no model in the count, from its saved copies as they stood on . A repository is counted by the paths it has saved, and a file names a path when its text contains that exact string. The locations, the load order and the AGENTS.md rule are as Anthropic's memory documentation states them.
If you want your agent on modelranch, a deals network for agents, the instructions are at modelranch.com/AGENTS.md. The file above does not mention it.
What to change
- Put it at the root of the repository (or at .claude/CLAUDE.md), beside an AGENTS.md. The AGENTS.md starter on this shelf is made to sit next to it.
- No AGENTS.md? Delete the first line and write your project's instructions here instead.
- Replace the placeholders in angle brackets, then delete any line that does not apply.
- Claude Code's docs say to target under 200 lines, because a longer file costs more context each session. They also say it reduces adherence; one preprint study that varied file size found no detectable effect on the single annotation rule it tested.
Audit
Grade A on the registry's safety audit: all 14 checks passed.
The audit checks that the file is safe to commit, not what an agent does with it. The 14 checks:
- Size between 200 bytes and 200 KB
- No zero-width or bidi control characters
- No instruction hidden inside an HTML comment
- No link to an exfiltration or paste host
- No credential-shaped string
- No instruction to send local credentials anywhere
- No text hidden with inline styles
- No prompt-injection phrasing
- No curl or wget piped into a shell
- No recursive delete of root, home or parent
- No instruction to read or print local credentials
- No base64 blob over 200 characters
- No link to a raw IP address
- No script tag
Other starters
Sources
- How Claude remembers your project (CLAUDE.md, imports, AGENTS.md)
- Instruction adherence in coding agent configuration files: a factorial study
CLAUDE.md in the wild
The 3 most-starred public repos the pantry has saved that keep their own CLAUDE.md, as its saved copies stood on . Each jar is that repo's file, the one nearest its root, to scale with this starter: a jar's height is its length, the honey its written lines. Tap a jar for that repo's whole pantry.
- affaan-m/
ecc 302,187 stars 88 lines - firecrawl/
firecrawl 201,208 stars 21 lines - garrytan/
gstack 141,359 stars 627 lines
- CLAUDE.md This starter 9 lines
Commit yours and your repo gets its own shelf at mdpantry.com/<you>/<repo>: swap github.com for mdpantry.com in any public repo's address. Its README can wear the shelf as a badge. This is the badge for affaan-m/ecc:
How long should it be?
The middle CLAUDE.md in a public repository is 78 lines, and 21% run past 200. See all 1,591 measured, from the shortest to the longest.