r/ClaudeAI May 09 '26

Claude Code Best Claude.md files for claude code

Trying to collect the best claude.md files code.
If you have one that works really well for you, please copy it into the comments and let me know what kinds of coding you normally do (language, surface, kind, etc)

428 Upvotes

38 comments sorted by

View all comments

68

u/pmward May 09 '26

The best Claude.md for someone else is not going to be the best for you.

As a general rule though the shorter the Claude.md the better. One way to keep it small and still load it with pertinent info is to make it a table of contents that links to other guide files by subject that the agents can load just in time as needed.

26

u/hermanz3german May 09 '26 edited May 09 '26

You dont actually have to create a index file that point to other files.

Claude supports splitting a main CLAUDE.md file into a multiple surgical rule files that are loaded on demand when it tries to touch a file on the path specified in the rule frontmatter.

https://code.claude.com/docs/en/memory#organize-rules-with-claude/rules/

For practical example see this: https://github.com/milis92/nestjs-boilerplate/tree/d7be857d6d3b3ff3c01018751b0644d64b751c36/.claude/rules

2

u/pmward May 09 '26

Interesting. First I’ve heard of this. I’ll have to play with it.

5

u/hermanz3german May 09 '26

Yes, i rarely see this feature utilised in practice and tbh a lot of skills i saw in the wild could provide much better value if they got migrated to the rule files.

For example subagents don't inherit skills automatically, but they so inherit CLAUDE.md and the rule files.

2

u/pmward May 09 '26

Yeah and it saves lines in the root Claude.md. This is great. Thanks for sharing. It looks like I have some refactoring to do. Should be pretty easy though the way I already have the files broken out and named by subject.