Anatomy of the .claude/ Folder

(blog.dailydoseofds.com)

153 points | by freedomben 2 hours ago

28 comments

  • exitb 1 hour ago
    I’m seeing this more and more, where people build this artificial wall you supposedly need to climb to try agentic coding. That’s not the right way to start at all. You should start with a fresh .claude, empty AGENTS.md, zero skills and MCP and learn to operate the thing first.
    • Aurornis 9 minutes ago
      This article isn't saying you must set up a big .claude folder before you start. It repeats several times that it's important to start small and keep it short.

      It's also not targeted at first-timers getting their first taste of AI coding. It's a guide for how to use these tools to deal with frustrations you will inevitably encounter with AI coding.

      Though really, many of the complaints about AI coding on HN are written by beginners who would also benefit from a simple .claude configuration that includes their preferences and some guidelines. A frequent complaint from people who do drive-by tests of AI coding tools before giving up is that the tools aren't reading their mind or the tools keep doing things the user doesn't want. Putting a couple lines into AGENTS.md or the .claude folder can fix many of those problems quickly.

    • jameshart 1 hour ago
      Yes, but as soon as you start checking in and sharing access to a project with other developers these things become shared.

      Working out how to work on code on your own with agentic support is one thing. Working out how to work on it as a team where each developer is employing agentic tools is a whole different ballgame.

      • sceptic123 43 minutes ago
        But why is it different? Why does it need to be? I don't write code the same as other devs so why would/should I use AI the same?

        Is this a hangover from when the tools were not as good?

        • IanCal 5 minutes ago
          > I don't write code the same as other devs

          Most people do, most people don’t have wildly different setups do they? I’d bet there’s a lot in common between how you write code and how your coworkers do.

        • lucideer 16 minutes ago
          I'd see this as being useful for two reasons:

          1. Provision of optional tools: I may use an ai agent differently to all other devs on a team, but it seems useful for me to have access to the same set of project-specific commands, skills & MCP configs that my colleagues do. I amn't forced to use them but I can choose to on a case by case basis.

          2. Guardrails: it seems sensible to define a small subset of things you want to dissuade everyone's agents from doing to your code. This is like the agentic extension of coding standards.

        • thierrydamiba 19 minutes ago
          [dead]
      • georgeburdell 1 hour ago
        In my own group, agentic coding made sharing and collaboration go out the window because Claude will happily duplicate a bunch of code in a custom framework
        • mitchell_h 27 minutes ago
          In my AGENTS.md I have two lines in almost every single one: - Under no condition should you use emoji's. - Before adding a new function, method or class. Scan the project code base, and attached frame works to verify that something else can not be modified to fit the needs.
          • himmi-01 2 minutes ago
            I'm curious about the token usage when it scans across multiple repositories to finding similar methods. As our code grows so fast, is it sustainable ?
    • pgwhalen 11 minutes ago
      Who is building an artificial wall? Maybe I skimmed the post too fast, but it doesn't seem like this information is being presented as "you have to know/do this before you start agentic engineering", just "this is some stuff to know."
    • Fishkins 1 hour ago
      I agree with most of this, with one important exception: you should have some form of sandboxing in place before running any local AI agent. The easiest way to do that is with .claude/settings.json[0].

      This is important no matter how experienced you are, but arguable the most important when you don't know what you're doing.

      0: or if you don't want to learn about that, you can use Claude Code Web

      • gawa 32 minutes ago
        The part about permissions with settings.json [0] is laughable. Are we really supposed to list all potential variations of harmful commands? In addition to the `Bash(cat ./.env)`, we would also need to add `Bash(cat .env)`, Bash(tail ./.env)`, Bash(tail .env)`, `Bash(head ./.env)`, `Bash(sed '' ./.env)`, and countless others... while at the same time we allow something like `npm` to run?

        I know the deny list is only for automatically denying, and that non-explicitly allowed command will pause, waiting for user input confirmation. But still it reminds me of the rationale the author of the Pi harness [1] gave to explain why there will be no permission feature built-in in Pi (emphasis mine):

        > If you look at the security measures in other coding agents, *they're mostly security theater*. As soon as your agent can write code and run code, it's pretty much game over. [...] If you're uncomfortable with full access, run pi inside a container or use a different tool if you need (faux) guardrails.

        As you mentioned, this is a big feature of Claude Code Web (or Codex/Antigravity or whatever equivalent of other companies): they handle the sand-boxing.

        [0] https://blog.dailydoseofds.com/i/191853914/settingsjson-perm...

        [1] https://mariozechner.at/posts/2025-11-30-pi-coding-agent/#to...

      • post-it 52 minutes ago
        The default sandboxing works fine for me. It asks before running any command, and I can whitelist directories for reading and non-compound commands.
      • sroussey 36 minutes ago
        Do people really run claude and other clis like this outside a container??
        • kenforthewin 22 minutes ago
          Let's not fool ourselves here. If a security feature adds any amount of friction at all, and there's a simple way to disable it, users will choose to do so.
    • freedomben 1 hour ago
      I totally agree with you that this not the right way to start. But, in my experience, the more you use the tool the more of a "feel" you get for it, and knowing how all these different pieces work and line up can be quite useful (though certainly not mandatory). It's been immensely frustrating to me how difficult it is to find all this info with all the low-quality junk that is out there on the internet.
      • embedding-shape 1 hour ago
        > all the low-quality junk that is out there on the internet.

        Isn't this article just another one in that same drawer?

        > What actually belongs in CLAUDE.md - Write: - Import conventions, naming patterns, error handling styles

        Then just a few lines below:

        > Don’t write: - Anything that belongs in a linter or formatter config

        The article overall seems filled with internal inconsistencies, so I'm not sure this article is adding much beyond "This is what an LLM generated after I put the article title with some edits".

    • beyonddream 42 minutes ago
      .claude has become the new dotfiles. And what do people do when they want to start using dotfiles ? they copy other’s dotfiles and same is happening here :)
    • hmokiguess 46 minutes ago
      with Anthropic already starting to sell "Claude Certified Architect" exams and a "Partner Network Program", I think a lot of this stuff is around building a side industry on top of it unfortunately
    • heliumtera 1 hour ago
      Operate == me send https post and pray for the best
      • dietr1ch 1 hour ago
        That's the goal, keep spending tokens and claim you are super productive because of it
  • bagrow 2 hours ago
    Here's a question that I hope is not too off-topic.

    Do people find the nano-banana cartoon infographics to be helpful, or distracting? Personally, I'm starting to tire seeing all the little cartoon people and the faux-hand-drawn images.

    Wouldn't Tufte call this chartjunk?

    • push0ret 1 hour ago
      I haven't come around any AI generated imagery in documents / slides that adds any value. It's more the opposite, they stand out like a sore thumb and often even reduce usability since text cannot be copied. Oh and don't get me started on leadership adding random AI generated images to their emails just to show that they use AI.
      • linux2647 1 hour ago
        > Oh and don't get me started on leadership adding random AI generated images to their emails just to show that they use AI

        Feels like generated AI art like this is modern clipart

      • GaggiX 1 hour ago
        It may be survivorship bias, you only notice the AI ones that are bad.
        • spunker540 1 hour ago
          Yeah there are almost certainly times when it is gen ai and you just didn’t notice.
    • randusername 12 minutes ago
      Tufte is evergreen. Zinsser is another.

      > Clutter is the disease of American writing. We are a society strangling in unnecessary words, circular constructions, pompous frills and meaningless jargon.

      > Look for the clutter in your writing and prune it ruthlessly. Be grateful for everything you can throw away. Reexamine each sentence you put on paper. Is every word doing new work? Can any thought be expressed with more economy?

      On Writing Well (Zinsser)

    • elcapitan 1 hour ago
      When I see AI images, I skip them, and most likely, the entire article. They're a better warning sign than the ones hidden in the text.
      • SV_BubbleTime 1 hour ago
        Yeah, I’ve been considering this. They’re going to start removing em dashes, which currently is a surefire way to detect AI text.

        Let’s say lose those and using emojis as bullet points. It’s going to be a lot harder to detect.

        • slopinthebag 22 minutes ago
          I don't actually look for em dashes or emojis as indicators, I can tell just from a few paragraphs if the pacing and flow is AI slop.
    • ramon156 2 hours ago
      LinkedIn loves these, even if they're broken.

      But they had already lost me at all the links, and the fact there's not a red wire through the entire article.

      The first thing my eyes skimmed was:

      > CLAUDE.md: Claude’s instruction manual

      > This is the most important file in the entire system. When you start a Claude Code session, the first thing it reads is CLAUDE.md. It loads it straight into the system prompt and keeps it in mind for the entire conversation.

      No it's not. Claude does not read this until it is relevant. And if it does, it's not SOT. So no, it's argumentatively not the most important file.

      • frotaur 24 minutes ago
        Are you certain? My understanding was that this is automatically injected in the context, and in my experience that's how it worked. I never see 'ReadFile(claude.md)', and yet claude is aware of some conventions I put in there.
      • SV_BubbleTime 1 hour ago
        Maybe. But I kind of view LinkedIn as a social network for people who only by the grace of a couple better decisions are talking about real business and not multilevel marketing schemes… but otherwise use the same themes and terminologies.

        Like mostly people who have confused luck and success, or business acumen for religion.

        So I wouldn’t use LinkedIn as a positive data point of what’s hot.

    • matsemann 20 minutes ago
      I never trust them to actually be correct. Aka they're probably worse than useless.
    • fny 1 hour ago
      This is equivalent to "do people find PowerPoint to be helpful or distracting." Sometimes yes, mostly no.

      In this case, I'd say helpful because I didn't have to read the article at all to understand what was being communicated.

    • freedomben 1 hour ago
      Most of the time I find them distracting, and sometimes a huge negative on the article. In this particular article though, they're well done and relevant, and I think they add quite a bit. It's a highly personal opinion kind of thing though for sure.
      • SV_BubbleTime 1 hour ago
        The first one is actually quite good.

        Some of the others, I don’t feel like added value, but I agree that these are some of the best of a practice that I agreed does not add a ton of value typically

    • browningstreet 1 hour ago
      I think it's fine. As someone who blogged a lot, the instant visual differentiation among articles offered by the art within is actually valuable.
    • btucker 1 hour ago
      It's not necessarily an AI-generated infographics issue, it's that these aren't good infographics. The graphic part is adding minimal value.
    • eitally 1 hour ago
      I am a victim of AI-documentation-slop at work, and the result is that I've become far more "Tuftian" in my preferences than ever before. In the past, I was a fan of beautiful design and sometimes liked nice colors and ornaments. Now, though, I've a fan of sparse design and relevant data (not information -- lots of information is useless slop). I want content that's useful and actionable, and the majority of the documents many of my peers create using Claude, Gemini or ChatGPT are fluffy broadsheets of irrelevant filler, rarely containing insights and calls-to-action.

      So yes, it's chartjunk.

    • simonw 1 hour ago
      My eye has started skipping past them, even though they're often quite useful if you engage with them.

      I think the problem is that they're uninformative slop often enough that I've subconsciously determined they aren't worth risking attention time on.

    • heliumtera 1 hour ago
      No. It adds nothing so nothing is preferred
  • giancarlostoro 7 minutes ago
    The real wall I never see people talking about is, yes, you can tell Claude to update whatever file you want, but you have to be aware that if it's .claude/INSTRUCTIONS.md or CLAUDE.md that you need to tell Claude to re-read those files because it wrote the contents but its not treating it as if it were fresh instructions, it will run off whatever the last time it read that file was, so if it never existed, it will not know. I believe Claude puts those instructions in a very specific part of its context window.
  • dataviz1000 18 minutes ago
    Claude Fast has very good alternate documentation for this. [0] I don't understand the hate for defining .claude/ . It is quite easy to have the main agent write the files. Then rather doing one shot coding, instead iterate quickly updating .claude/ I'm at the point where .claude/ makes copies of itself, performs the task, evaluates, and updates itself. I'm not coding code, I'm coding .claude/ which does everything else. This is also a mechanism for testing .claude, agents, and instructions which would be useful for sharing and reuse in an organization.

    [0] https://claudefa.st/blog/guide/mechanics/claude-md-mastery

  • sergiotapia 1 minute ago
    In my experience fewer skills is significantly better.

    When you have this performative folder of skills the AI wastes a bunch of tool calls, gets confused, doesn't get to the meat of the problem.

    beware!

  • Synthetic7346 1 hour ago
    I wish all model providers would converge on a standard set of files, so I could switch easily from Claude to Codex to Cursor to Opencode depending on the situation
    • embedding-shape 1 hour ago
      Issue is that both harness and specific model matters a lot in what type of instruction works best, if you were to use Anthrophic's models together with the best way to do prompting with Codex and GPT models, you'd get a lot worse results compared to if you use GPT models with Codex, prompted in the way GPTs react best to them.

      I don't think people realize exactly how important the specific prompts are, with the same prompt you'd get wildly different results for different models, and when you're iterating on a prompt (say for some processing), you'd do different changes depending on what model is being used.

      • freedomben 1 hour ago
        Having experimented with soft-linking AGENTS.md into CLAUDE.md and GEMINI.md, this lines up well with my experience. I now just let each time maintain it's own files and don't try to combine them. If it's something like my custom "## Agent Instructions" then I just copy-pasta and it's not been hard, and since that section is mostly identical I just treat AGENTS.md as the canonical and copy/paste any changes over to the others.
      • dbmikus 58 minutes ago
        Are there any good guides on how to write prompt files tailored to different agents?

        Would also be interested in examples of a CLAUDE.md file that works well in Claude, but works poorly with Codex.

        • dhorthy 21 minutes ago
          I think one of the main examples that i saw in a swyx article a while back is that using the sort of ALL CAPS and *IMPORTANT* language that works decently with claude will actually detune the codex models and make them perform worse. I will see if I can find the post
    • heliumtera 1 hour ago
      And why would they ever let switch?
      • Synthetic7346 29 minutes ago
        Interoperability means that people could switch to them as well
  • saadn92 48 minutes ago
    The claim that "whatever you write in CLAUDE.md, Claude will follow" is doing a lot of heavy lifting. In practice CLAUDE.md is a suggestion, not a contract. Complex tasks and compaction will dilute the use of CLAUDE.md, especially once the context window runs out.
    • dgb23 21 minutes ago
      This is correct. All of these .md files are just blobs of text that the LLM matches against. They might increase the likelihood of something happening or not happening.

      They look to me like people actually want to build deterministic workflows, but blobs of text are the wrong approach for that. The right tool is code that controls the agent through specific states and validates the tool calls step by step.

  • BuildItBusk 41 minutes ago
    I think this does a great job of explaining the .claude directories in a beginner friendly way. And I don’t necessarily read it as “you have to do all this, before you start”.

    It has a few issues with outdated advice (e.g. commands has been merged with skills), but overall I might use share it with co-workers who needs an introduction to the concept.

  • phyzix5761 1 hour ago
    Is there a completely free coding assistant agent that doesn't require you to give a credit card to use it?

    I recently tried IntelliJ for Kotlin development and it wanted me to give a credit card for a 30 day trial. I just want something that scans my repo and I tell it the changes I want and it does it. If possible, it would also run the existing tests to make sure its changes don't break anything.

    • bityard 57 minutes ago
      There are lots! Too many to cover in a single HN comment, and this space is evolving rapidly so I encourage you to look around.

      While the coding assistants are pretty much universally free, you still need to connect them to a model. The model tokens generally cost something once you've gone past a certain quota.

      I'm not sure if this is still true, but if you have a Google account, Gemini Code Assist had a quite generous "free tier" that I used for a while and found it do be pretty decent.

    • bhaak 1 hour ago
      Gemini Code Assist has a free tier.

      You log in with your Goggle account.

    • sunir 1 hour ago
      Qwen code has a free tier

      Opencoder is bring your own model.

      You get what you pay for so good luck.

  • forgotusername6 57 minutes ago
    If these different agents could agree on a standard location that would be great. The specs are almost the same for .github and Claude but Claude won't even look at the .github location.
    • dmix 32 minutes ago
      There already is, it's ~/.agents and you use symlinks for .claude, and the dir structure is pretty similar and anything you want to reuse across models is pretty standardized, just not formalized.
  • TheRoque 1 hour ago
    So that's what "software engineering" has become nowadays ? Some cargo cult basically. Seriously all of this gives red flag. No statements here are provable. It's just like langhchain that was praised and then everyone realized it's absolute dog water. Just like MCP too. The job in 2026 is really sad.
    • graypegg 1 hour ago
      I think I'm finding a pretty good niche for myself honestly. IMO, Software engineering is more so splitting into different professions based on the work is produces.

      This sort of "prompt and pray" flow really works for people, as in they can make products and money, however, I do think the people that succeed today also would've reached for no-code tools 5 years ago and seen similar success. It's just faster and more comprehensive now. I think the general theme of the products remains the same though; not un-important or worthless, but it tends to be software that has effects that say INSIDE the realm of software. I feel like there's always been a market for that, as it IS important, it's just not WORTH the time and money to the right people to "engineer" those tools. A lot of SaaS products filled that niche for many years.

      While it's not a way I want to work, I am also becoming comfortable with respecting that as a different profession for producing a certain brand of software that does have value, and that I wasn't making before. The intersection of that is opportunity I'm missing out on; no fault to anyone taking it!

      The software engineer that writes the air traffic avoidance system for a plane better take their job seriously, understand every change they make, and be able to maintain software indefinitely. People might not care a ton about how their sales tracking software is engineered, but they really care about the engineering of the airplane software.

      • sarchertech 1 hour ago
        I think this is mostly right. The primary difference is that with no code you had to change platforms, but the Prompt and Pray method can be brought to bear on any software easily even the air traffic avoidance system.

        It shouldn’t be, but it’s going to take some catastrophic events to convince people that we have to work to make sure we understand the systems we’re building and keep everything from devolving into vibe coded slop.

        • graypegg 57 minutes ago
          > the Prompt and Pray method can be brought to bear on any software easily even the air traffic avoidance system.

          I guess that's why I see it as a separate profession, as in we have to actually profess a standard for how a professional in our field acts and believes. I think it's OK for it to bifurcate into two different fields, but Software Engineering would need to specifically reject prompt-and-pray on a principled and rational basis.

          Sadly yes, that might require real cost to life in order to find out the "why" side of that rational basis. If you meet anyone that went to an engineering school in Québec, ask them about the ceremony they did and the ring they received. [0] It's not like that ceremony fixes anything, but it's a solemn declaration of responsibility which to me at least, sets a contract with society that says "we won't make things that harm you".

          [0] https://ironring.ca/home-en/

              > [The] history of the 1907 failure of the Quebec City bridge, which was the inspiration for the Calling of an Engineer ceremony.
      • baal80spam 1 hour ago
        > prompt and pray

        This is a brilliant reimagining of the old and trusted PnP acronym.

    • sunir 1 hour ago
      When was it not a cargo cult?
  • frizlab 40 minutes ago
    Completely tangential, but can we please stop putting one million files at the root of the project which have nothing to do with the project? Can we land on a convention like, idk, a `.meta` folder (not the meta company, the actual word), or whatever, in which all of these Claude.md, .swift-version, Code-of-Conduct.md, Codeowners, Contributing.md, .rubocop.yml, .editorconfig, etc. files would go??
    • flurdy 37 minutes ago
      I was glad when linux went with the .config standard for most dotfiles.
  • manudaro 1 hour ago
    The .claude folder structure reminds me of how Terraform organizes state files. Smart move putting conversation history in Json rether than some propiertary format, makes it trivial to grep through old conversations or build custom analysis tools.
    • unshavedyak 1 hour ago
      Claude itself will grep through old conversations so it’s handy that Claude understands too
  • 63stack 1 hour ago
    The article starts off really weak:

    >Claude Code users typically treat the .claude folder like a black box. They know it exists. They’ve seen it appear in their project root. But they’ve never opened it, let alone understood what every file inside it does.

    I know we are living in a post-engineering world now, but you can't tell me that people don't look at PRs anymore, or their own diffs, at least until/if they decide to .gitignore .claude.

    • fogzen 10 minutes ago
      I don't. I have Claude do all my PR reviews, running in a daily loop in the morning. The truth is an LLM is better at code review than the average programmer.

      I'm a senior engineer who has been shipping code since before GitHub and PR reviews was a thing. Thankfully LLMs have freed me from being asked to read other people's shit code for hours every day.

    • sunir 1 hour ago
      You’re assuming most people using Claude code are senior engineers.
      • politelemon 1 hour ago
        And that we're living in a post engineering world.
  • jwilliams 1 hour ago
    > Simply put: whatever you write in CLAUDE.md, Claude will follow.

    No.

    CLAUDE.md is just prompt text. Compaction rewrites prompt text.

    If it matters, enforce it in other ways.

  • BoredPositron 1 hour ago
    Alchemy.
  • rdevilla 58 minutes ago
    The fuck? What's next, configuring maven and pom.xml? At least XML is unambiguous, well specified, and doesn't randomly refuse to compile 2% of the time..
  • akalidz 26 minutes ago
    interesting
  • submeta 51 minutes ago
    Tangential: The image with the heading "Anatomy of the .claude/ folder" is nicely made, anyone knows what tool is used for it?
  • PetrBrzyBrzek 43 minutes ago
    Why is this AI slop article first on HN?
  • galoisscobi 1 hour ago
    > Most people either write too much or too little. Here’s what works.

    > Two folders, not one

    Why post AI slop here?

    • rvz 1 hour ago
      "Thinking" is about to get even harder to do for most grifters with newsletters to sell.
  • groby_b 1 hour ago
    100% AI slop. All the way to "The Key Insight".
  • ohsecurity 25 minutes ago
    [dead]
  • grey-area 1 hour ago
    [dead]
  • cestivan 2 hours ago
    [dead]