CLAUDE.md
site/content/CLAUDE.mdCLAUDE.md
Quality
77/100
Scores the file, not the repository.Length
648 words
8 headings · 1 code blocksRepository
259
— · pushed 10 days agoLast changed
3 days ago
First indexed 3 days ago.1# CLAUDE.md23A markdown file that gives Claude persistent context about your project. Loaded into every session automatically, no manual prompting required.45## Quick Start671. Run `/init` in Claude Code. It analyses your codebase and generates a starter `CLAUDE.md`82. Review and refine what it creates. Add what Claude can't infer on its own93. Commit to version control so your team shares the same context104. Iterate over time. Add instructions as you discover friction points1112## What to Put in It1314| Section | Purpose | Example |15|---|---|---|16| Project overview | Orient Claude in your codebase | Tech stack, architecture, key directories |17| Build & test commands | Let Claude run your workflows | `npm test`, `cargo build`, `make deploy` |18| Code conventions | Enforce your team's style | Naming, imports, error handling patterns |19| Common workflows | Prevent rework | Branch naming, PR process, deploy steps |20| Tool & MCP notes | Connect Claude to your environment | Custom scripts, [MCP](^Model Context Protocol: a standard that lets Claude connect to external tools and services) server usage notes |21| Gotchas & warnings | Avoid known pitfalls | Files not to edit, quirks, env requirements |2223## Where It Can Live2425| Location | Scope | Use For |26|---|---|---|27| `./CLAUDE.md` | Project (shared) | Team standards, architecture, build commands |28| `./.claude/CLAUDE.md` | Project (shared) | Same as above, alternate location |29| `~/.claude/CLAUDE.md` | Personal (all projects) | Your preferences across every project |30| `./CLAUDE.local.md` | Personal (this project) | Your sandbox URLs, preferred test data. [Gitignored](^Automatically added to .gitignore so it stays local and is never committed to version control) |31| [Managed policy path](^A system-level path managed by IT/DevOps. macOS: /Library/Application Support/ClaudeCode/CLAUDE.md, Linux: /etc/claude-code/CLAUDE.md, Windows: C:\Program Files\ClaudeCode\CLAUDE.md) | Organisation-wide | Company security policies, compliance rules |3233More specific locations take precedence over broader ones. Claude also discovers `CLAUDE.md` files in subdirectories and loads them on demand when working in those directories.3435## Importing Files3637Use `@path/to/file` syntax to pull additional files into context:3839```markdown40See @README.md for project overview.41Git workflow: @docs/git-instructions.md42```4344- Relative paths resolve from the file containing the import45- Imports can chain up to 5 levels deep46- First use in a project triggers an approval dialog47- Great for pulling in READMEs, package.json, or workflow guides without duplicating content4849## Writing Effective Instructions5051- **Be specific**: [Use 2-space indentation](^A concrete, verifiable instruction Claude can follow exactly) not [Format code properly](^Too vague for Claude to act on consistently. What does 'properly' mean?)52- **Be concise**: Target under 200 lines. Longer files [dilute adherence](^The more instructions Claude has to track, the less reliably it follows each one)53- **Use structure**: Markdown headers and bullets. Claude scans structure like a reader does54- **Avoid conflicts**: If two instructions contradict, Claude picks one arbitrarily. Review periodically55- **Split when large**: Use [@ imports](^The @path/to/file syntax described above that pulls other files into CLAUDE.md context) or `.claude/rules/` files to break up long instructions5657## Tips5859- CLAUDE.md is [context, not enforcement](^Claude reads it and tries to follow it, but there is no strict guarantee. Specific, unambiguous instructions get the best results). Specific instructions are followed more reliably than vague ones60- `/init` works on existing projects too. It suggests improvements rather than overwriting61- Use `/clear` between unrelated tasks to reset accumulated context while keeping CLAUDE.md loaded62- CLAUDE.md [survives /compact](^When you run /compact, Claude re-reads CLAUDE.md from disk and re-injects it fresh. Instructions given only in conversation will be lost, but CLAUDE.md persists). It is re-read from disk and re-injected fresh63- Never include secrets, API keys, or credentials. Treat it as public documentation64- Start simple. Expand based on real friction, not hypothetical needs6566## Further Reading6768- [Official docs: How Claude remembers your project](https://code.claude.com/docs/en/memory#claude-md-files)69- [Blog: Using CLAUDE.md files](https://claude.com/blog/using-claude-md-files)
Also in LukeRenton/explore-claude-code
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| LukeRenton/explore-claude-codeCLAUDE.md · 259 | CLAUDE.md | archagent-behaviour | 73/100 | 3 days ago | |
| LukeRenton/explore-claude-codesite/content/.claude/agents/AGENTS.md · 259 | AGENTS.md | styleagent-behaviour | 58/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| livewire/livewireCLAUDE.md · 24k | CLAUDE.md | setupbuildteststyle+4 | 100/100 | 3 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today |
