logoalt Hacker News

peteeyesterday at 10:19 PM3 repliesview on HN

Any tricks to get Claude to actually use the CLAUDE.md consistently? Many times now its completely ignored it, despite being short, concise + generated by Claude itself, and I see bug reports about this that are over a year old


Replies

giancarlostorotoday at 6:04 AM

If you JUST updated it, have Claude re-read it, this was the biggest thing for me. If you just created it, same thing. Even though Claude created the file, it has not read it in whatever special way Claude will read that file, which is silly, but once you realize this, and have Claude read it, it makes a difference. It will always load it from a new session, but if it changes or doesn't exist when you start a session it will be stale or empty.

sdesoltoday at 1:32 AM

What behavioural things are you noticing that Claude does not pickup from the CLAUDE.md. I am working on a `pi-brains` extension for the Pi agent. It is designed to inject rules into write and edits tool calls for matching files.

I am curious if the behaviour you want is outside of writing and editing files.

devmoryesterday at 10:54 PM

Check out your session logs and review what is actually in the context window. I’m willing to bet that your CLAUDE.md is sitting close to the middle of everything in there. The current gen of frontier models tends to heavily weight the start and end of the current context so heavily that anything partway through may just be ignored.