Comment by stingraycharles

Comment by stingraycharles 3 days ago

33 replies

That’s hilarious and a great way to test this.

What I’m surprised about is that OP didn’t mention having multiple CLAUDE.md files in each directory, specifically describing the current context / files in there. Eg if you have some database layer and want to document some critical things about that, put it in “src/persistence/CLAUDE.md” instead of the main one.

Claude pulls in those files automatically whenever it tries to read a file in that directory.

I find that to be a very effective technique to leverage CLAUDE.md files and be able to put a lot of content in them, but still keep them focused and avoid context bloat.

sroussey 2 days ago

Ummm… sounds like that directory should have a readme. And Claude should read readme files.

  • stingraycharles 2 days ago

    READMEs are written for people, CLAUDE.mds are written for coding assistants. I don’t write “CRITICAL (PRIORITY 0):” in READMEs.

    The benefit of CLAUDE.md files is that they’re pulled in automatically, eg if Claude wants to read “tests/foo_test.py” it will automatically pull in “tests/CLAUDE.md” (if it exists).

    • llbeansandrice 2 days ago

      If AI is supposed to deliver on this magical no-lift ease of use task flexibility that everyone likes to talk about I think it should be able to work with a README instead of clogging up ALL of my directories with yet another fucking config file.

      Also this isn’t portable to other potential AI tools. Do I need 3+ md files in every directory?

      • whywhywhywhy 2 days ago

        > Do I need 3+ md files in every directory?

        Don’t worry, as of about 6 weeks ago when they changed the system prompt Claude will make sure every folder has way more than 3 .md files seen as it often writes 2 or more per task so if you don’t clean them up…

      • mewpmewp2 2 days ago

        Is your logic that unless something is perfect it should not be used even though it is delivering massive productivity gains?

      • stingraycharles 2 days ago

        It’s not delivering on magical stuff. Getting real productivity improvements out of this requires engineering and planning and it needs to be approached as such.

        One of the big mistakes I think is that all these tools are over-promising on the “magic” part of it.

        It’s not. You need to really learn how to use all these tools effectively. This is not done in days or weeks even, it takes months in the same way becoming proficient in eMacs or vim or a programming language is.

        Once you’ve done that, though, it can absolutely enhance productivity. Not 10x, but definitely in the area of 2x. Especially for projects / domains you’re uncomfortable with.

        And of course the most important thing is that you need to enjoy all this stuff as well, which I happen to do. I can totally understand the resistance as it’s a shitload of stuff you need to learn, and it may not even be relevant anymore next year.

    • pmarreck 2 days ago

      > “CRITICAL (PRIORITY 0):”

      There's no need for this level of performative ridiculousness with AGENTS.md (Codex) directives, FYI.

    • brigandish 2 days ago

      I often can't tell the difference between my Readme and Claude files to the point that I cannibalise the Claude file for the Readme.

      It's the difference between instructions for a user and instructions for a developer, but in coding projects that's not much different.

    • adastra22 2 days ago

      Is this documented anywhere? This is the first I have ever heard of it.

      • grumbelbart 2 days ago

        Here: https://www.anthropic.com/engineering/claude-code-best-pract...

        claude.md seems to be important enough to be their very first point in that document.

        • ffsm8 2 days ago

          Naw man, it's the first point because in April Claude code didn't really gave anything else that somewhat worked.

          I tried to use that effectively, I even started a new greenfield project just to make sure to test it under ideal circumstances - and while it somewhat worked, it was always super lackluster and way more effective to explicitly add the context manually via prepared md you just reference in the prompt.

          I'd tell anyone to go for skills first before littering your project with these config files everywhere