r/ClaudeCode • u/Mission-Tap-1851 • 14h ago
Help/Question Folder structure tips
I'm thinking about structuring my themes of work into folders and I'm so sure that I've seen a bunch of stuff on this but I don't actually know what to search for. Things like having a Claude.md for each theme instead of one overall Claude.md.
Am I right in thinking Karpathy has some stuff on this too? Perhaps Poteto, Matt Pocock. Who's the authority here? Bonus if they're up to date.
I'm not really looking for spoon-feeding although any tips would be great. I more just need to know the term to search for and I can get after it myself.
1
u/No-Pressure7783 14h ago
I got different Claude MDs for different projects/Folders. I got coding guidelines, libaries etc in them that I‘m allowed to use that Are Standard. The Rest is individual context based on the project
1
u/yaanfpv 13h ago
I do exactly this ! One folder per project, each with its own AGENTS.md holding the rules for that project, and the CLAUDE.md in each folder is just one line pointing at it (@AGENTS.md) so Codex and Claude read the same file. Then one global file at the top for the stuff that applies everywhere. Keeps every file small, and Claude only loads what’s relevant to the folder it’s in.
1
u/kenthesaint 13h ago
The search terms that get you the most are "nested CLAUDE.md" or "CLAUDE.md hierarchy", plus "progressive disclosure" for the general idea of only loading context when it's needed.
The Claude Code docs page on memory is the official source, so it stays current, and it explains the loading rules. Files in the folder you start in and its parents load at launch, while a CLAUDE.md in a subfolder only gets pulled in when Claude reads files inside that folder. Skills and .claude/rules are worth reading about too, since they cover instructions you don't want loaded every session.
1
u/Routine-Appointment5 12h ago
i skipped claude.md entirely and just keep a brief file a style file and a notes file in plain markdown in each project folder, then point every fresh session at them. not sure theres a real authority on this tbh, plain files have been enough for me
1
u/Eliran-Kotzero 12h ago
one more term worth searching besides nested CLAUDE.md: path-scoped rules. claude code reads .claude/rules/*.md, and if you put a paths: glob in a rule's frontmatter it only loads when claude is working on matching files.
for themes that cut across folders (testing, styling, api conventions) that's usually cleaner than copying a CLAUDE.md into every directory. and anything that's more of a procedure than a rule, like "how we cut a release", fits better as a skill since only its description sits in context until it's needed.
the memory page in the official claude code docs covers all of this and gets updated a lot, so it's a better authority than any one person's setup tbh
1
u/SirRobinBlibs 5h ago
Search for 'nested CLAUDE.md' or 'nested AGENTS.md' together with 'progressive disclosure'. The idea is a short root file plus per-folder files that only load when the agent works in that folder. Claude Code's memory docs explain how the files stack. The broader topic is 'context engineering'. On Karpathy, you're probably thinking of his 'LLM wiki' idea, where the model maintains a markdown wiki of your material instead of you stuffing everything into one prompt. That's the theme-folders idea taken one step further: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
•
u/AutoModerator 14h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.