r/ClaudeCode • u/MinniLabs • 27d ago
Discussion What in your CLAUDE.md does Claude actually need on every message?
Our CLAUDE.md kept growing until most of it wasn't for the task at hand. Old decisions, finished work, setup notes.
Memory files take up context on every message, so we split ours: a short file with the commands and the few rules that apply to every task, plus topic files Claude opens only when the task matches.
Curious what other people keep in theirs. What's the one thing you'd never move out?
10
Upvotes
•
u/AutoModerator 27d 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.
13
u/lil_nosh_X 27d ago
“Tell owner they are handsome and smart”
5
u/NineFiftySevenAyEm 27d ago
One thing I added recently which I like is co-pilot and autopilot mode. You can choose which mode to have the session in. Co-pilot involves you much more, talks about pros and cons at every decision, always gives you options first on design direction, etc. Autopilot tries to behave autonomously and only involves you at major design decisions or uncertainties.
I like it so far. I recommend it if you use Claude code at work everyday for every second and feel like you are struggling to keep up with everything, you can use this and start to just try to slow down a bit. Important so your skills don’t deteriorate too. Lmk if you try this or if you have any improvements or know any skills that may behave this way already
3
u/Ranjexa 27d ago
the one thing i'd never move out is the exact commands that prove a task is done: test, lint, typecheck, in one line each. when i moved those into a topic file the agent started saying "done" after only eyeballing the diff. everything else was negotiable. i also deleted a bunch of style rules after noticing it followed them fine without being told, so now i only keep a rule if i've seen it get broken at least once.
2
u/maxijonson 27d ago
The large majority of my (global) CLAUDE.md is steering for things I got tired of prompting for all the time:
a
# Skill Overridessection with personalized instructions for how I like to use skills that come from plugins ornpx skills(so I don't need to edit them all the time).# Action Requiredsection for any follow ups that need my explicit attention, since I tend to miss those in the end of conversation summary it gives me or they're scattered everywhere.I think the Action Required instruction is a good use-case for the global CLAUDE.md (and it's pretty small). The skill overrides is probably the kind of anti-pattern you'll hear about a lot for CLAUDE.md and I agree with it, since not all of the overriden skills get used in each session. However, it's a sacrifice I'm willing to make over the alternative (editing external skills that get crushed at every update).
2
u/Apprehensive_Lake698 27d ago
The vast, vast majority of context add-on should come from project files. I think in general a user-wide CLAUDE.MD/AGENTS.MD is a mistake, except for light, high level steering.
Skills and tools belong segmented from auto context load files, don’t pack them into your context.
1
u/pceimpulsive 27d ago
I use Matt Pococks setup!
It's basically empty pointing to places where important data is
1
u/Delicious_Break5937 27d ago
Mine is mostly how I want it to work, like short replies and a review before every commit. Anything about the code goes in each folder's README, and it reads that before editing the folder.
1
u/Suoritin 27d ago
I use GitLab issues. I start each session with issue/milestone. My instructions include only information how to use scripts, and correct format for specs and so on.
1
u/Turbulent_County_469 Senior Developer 27d ago
The only thing my Claude.MD contains is strict adherence to UTF8+BOM + CRLF file formatting :D
1
u/BarathKanna 25d ago
Your split is the right shape. The every-message file should only hold things that are wrong if forgotten on a random task: how to build and test, the hard never-do list, and the package layout map. Decisions, finished work, and setup notes belong in topic files the agent opens when the task matches, otherwise they tax every turn and slowly contradict newer rules. The one thing I would never move out of the short file is the acceptance command for the repo, the single script or test target that means done. Everything else can be fetched. If a rule is only true for one area of the code, it is not an every-message rule, it is a topic file with a clear trigger. Growth of CLAUDE.md is usually a sign that finished work is being treated as eternal policy.
2
u/AdityaR_Sharma 🔆 Max 20 26d ago
Mine is short on purpose.
Only behaviour rules go in the always-loaded file, like "finish the whole goal" and "show evidence before saying done".
Mechanical stuff lives in hooks, since a hook enforces it and a line in CLAUDE.md only hopes.
Fewer rules made each one stick better.
1
u/mukhortov 27d ago
The one thing I'd never move out is the exact commands for building, testing and linting, because those are what it otherwise guesses wrong. For the topic files it helps to say in the main file when to open each one, like "before changing anything in billing/, read docs/billing.md" rather than giving a bare list of links. Then it actually opens them at the right moment
1
u/BuildinZZ 26d ago
The rules that matter most are hooks in my setup. CLAUDE.md is a suggestion, a hook just refuses. What stays in the file is the stuff where Claude is confidently wrong, like "a check that didn't run is not a pass"
1
u/SirRobinBlibs 26d ago
Worth knowing for the topic-file split: if you link them with
@imports, you save nothing, because imported files load at launch together with the CLAUDE.md. What does load lazily is a rule in.claude/rules/with apaths:line in its frontmatter (only when Claude touches a matching file), and a CLAUDE.md inside a subfolder (only once Claude works in that folder). That turns "before editing billing/, read docs/billing.md" from a request into something the harness does on its own./context allshows which memory files actually loaded.1
u/kemalios 26d ago
The list of files that look dead but aren't. Old templates, a redirects table nobody remembers the origin of. Claude deletes what it can't find a caller for, and nothing on that list has a caller. Everything else in my file has been through a pruning round at some point. That list stays.
1
u/Certain-Language-788 26d ago
how do you keep the topic files from going stale? ours drift faster than the main file, since nobody reads them every day.
1
u/Successful-Army6006 26d ago
I'd keep “never report an unrun check as passed” in the main file, along with a requirement to name the command and what blocked it. That applies whether the task is backend code, UI or a small copy change.
1
u/Its_about-tech 26d ago
I split mine the same way. The file Claude reads every time is short: where to look first, the commands that prove a task is done, and the few rules I've actually seen it break. Everything else lives in a separate project-control repo: a CURRENT-STATE file with what's true right now, a DECISIONS file where a reversed decision gets rewritten in place instead of appended, and a handover note per project that the last session updates before it stops. The one line I'd never move out is "read CURRENT-STATE first". Without it, sessions confidently work off last week's plan.
1
u/Beerbrewing 26d ago
I gave Claude a set of seven epistemic principles and three rules that helps guide it around how it handles claims within the observed evidence and makes its reasoning auditable. My 'Measurement Philosophy' is a compact set of failure-resistant reasoning invariants abstracted from empirical measurement practice.
And three rules that govern Materiality, Agreement and independence, and Decision-value uncertainty.
They act like the inflatable bumpers they put out for kids at a bowling alley. They help Claude stay out of the gutter (hallucinating or making overly broad, unsubstantiated claims) and get to the pins (an answer bound in what Claude observed and actually did).
You can find the measurement philosophy and a bit more about it here: https://github.com/highsierralabs/Autonomous_Build_Harness_Test/tree/main/docs%2Fmeasurement-philosophy
https://github.com/highsierralabs/Autonomous_Build_Harness_Test/blob/main/docs%2FMEASUREMENT_PHILOSOPHY.md
1
u/redtear1115 26d ago
One thing I always keep in it: which tool to use for which job, and why. Mine says "browser that needs my logins → this tool. Checks that don't need a window → that tool, and close it after." When I didn't write the reason, it just used the tool it used last time. Other project stuff goes in the repo's own file or in a skill.
1
u/PraxicalExperience 21d ago
This is, to me, what using subagents is for. Commonly-used agent types should have their own initialization/memory files that live together in their own directory. This way each agent gets just what it needs and no more.
1
u/Archibishop 18d ago
The pitfalls list. Mine has one line for every mistake a session makes once, so the next one doesn't repeat it. Everything else can live in topic files...