7 Comments
User's avatar
David Dors's avatar

Great information about how Claude.md works. The rules tip is really helpful as my Claude.md files tends to get bloated fast and I'm constantly trying to cut from it.

Have you seen or tried to compound engineering plugin. It auto captures solutions to problems and saves them down for you using skills and agents. It's a cool concept that Im trying to apply to my work.

Ilia Karelin's avatar

Thank you for reading the post David. Haven’t heard about the engineering plugin, but curious!

Alex Willen's avatar

I've got one Claude.md at my root directory and then another one in each project-specific subfolder, which definitely helps reduce size and make sure it's got the specific context necessary for whatever it's working on.

I definitely recommend having it put a note in Claude.md telling it to update Claude.md with any important findings while working, especially solutions to problems that have come up. It's a little hit or miss with actually updating it, so I still ask it to write things manually as well, but if I'm in the zone on something and don't remember to ask it to make an update, there's still a good chance it will anyway.

Ilia Karelin's avatar

Yes, agreed! Maintaining Claude.md file is important if you’re working with tools like Claude Code. It can become very powerful and save you time, token usage, etc.

Pawel Jozefiak's avatar

This hits home. I had the exact same problem - Claude forgetting migrations, directory moves, even the project's testing patterns between sessions.

My fix was kind of extreme: after 1000+ sessions with my agent Wiz, I ended up with a multi-layered CLAUDE.md system. Global instructions, project-specific rules, auto-memory that persists across conversations.

The '30-second habits' approach you describe is the right entry point. But what surprised me was how quickly a simple CLAUDE.md snowballs into something that needs actual architecture.

Wrote up my full structure after iterating for months: https://thoughts.jock.pl/p/how-i-structure-claude-md-after-1000-sessions

Curious - do you version control your CLAUDE.md, or keep it gitignored?

Paul Parker's avatar

Hmm…. This works but why not just use the memory skills? If those don’t suffice, have you tried creating one?

Having said that, yes, I believe compound engineering is the way to go.

Tilman's avatar

use a very similar approach, but I try to keep my CLAUDE.md as lean as possible. As others have already mentioned, when this file gets too long or too packed with information, the context window gets overloaded and the quality of results drops noticeably.

What solved this for me: I maintain a docs/ folder with dedicated files for architecture decisions, CI/CD pipelines, testing guidelines, and whatever else is needed. These are then linked from the CLAUDE.md rather than inlined. That way, the CLAUDE.md itself only contains the essentials.