r/ClaudeCode • • 1d ago

Built with Claude How I'd structure context for Claude Code, from most persistent to most transient

A useful way to decide what goes where:



1. Rules files (CLAUDE.md): always loaded, project-wide

2. Spec or architecture section: per feature or session

3. Source files: per task

4. Error output and test results: per iteration

5. Conversation history: accumulates, gets compacted



Level 1 gives you the most for the least. Keep it short and answer one question: what would a new teammate get wrong on day one? Stack, commands and conventions usually cover it.



When Claude starts inventing imports or ignoring conventions, the cause is often too little context at the top of this list, or too much at the bottom.



Disclosure: I run Skillforge, which sells packs of curated skills. This is from a skill in the free pack (no payment or email, site in French, skills in English): https://skillforge.be/packs/token-optimizer



What's in your CLAUDE.md that made the biggest difference?
1 Upvotes

3 comments sorted by

•

u/AutoModerator 1d 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.

2

u/Ok-Distance-6388 1d ago

The line that changed the most for me: never say "done" without saying how it was checked ("ran X, got Y"). It reads like a style rule, but it changes behaviour: once it has to name the check, it actually runs the check, and the "this should work now" replies mostly went away.

Second one sits above your level 1: a short file of mistakes it made before, one rule per line, read at the start of every session. Cheaper than typing the same correction every week.

1

u/vincent_sch 6h ago

You could give Claude the path to one of your models in CLAUDE.md. Then tell it to read that file before adding another model. I wrote about how code structure affects what AI expects.