Live data from Hacker News

Writing a good Claude.md

humanlayer.dev

151–160 of 304 posts

Re: Writing a good Claude.md

#151

Earlier quoted context omitted.

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

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).

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?

Re: Writing a good Claude.md

#152

I don't get the point. Point it at your relevent files ask it to review discuss the update refine it's understanding and then tell it to go. I have found that more context comments and info damage quality on hard problems. I actually for a long time now have two views for my code. 1. The raw code with no empty space or comments. 2. Code with comments I never give the second to my LLM. The more context you give the lo…

could u share some more intuition as to why you started believing that? are there ANY comments that are useful?

Re: Writing a good Claude.md

#153
post #118

Earlier quoted context omitted.

This is missing the point. If I want to instruct Claude to never write a database query that doesn't hit a preexisting index, where exactly am I supposed to document that? You can either choose: 1. A centralized location, like a README (congrats, you've just invented CLAUDE.md) 2. You add a docs folder (congrats, you've just done exactly what the author suggests under Progressive Disclosure) Moreover, you can't just…

This CLAUDE.md dance feels like herding cats. Except we’re herding a really good autocorrect encyclopedic parrot. Sans intelligence Relating / personifying LLM to an engineer doesn’t work out Maybe the best though model currently is just “good way to automate trivial text modifications” and “encyclopedic ramblings”

unfair characterization.

think about how this thing is interacting with your codebase. it can read one file at a time. sections of files.

in this UX, is it ergonomic to go hunting for patterns and conventions? if u have to linearly process every single thing u look at every time you do something, how are you supposed to have “peripheral vision”? if you have amnesia, how do you continue to do good work in a codebase given you’re a skilled engineer?

it is different from you. that is OK. it doesn’t mean its stupid. it means it needs different accomodations to perform as well as you do. accomodations IRL exist for a reason, different people work differently and have different strengths and weaknesses. just like humans, you get the most out of them if you meet and work with them from where they’re at.

Re: Writing a good Claude.md

#154

Earlier quoted context omitted.

That study is garbo and I suspect you didn't even read the abstract. Am I right?

I've heard this mentioned a few times. Here is a summarized version of the abstract: > ... We conduct a randomized controlled trial (RCT) > ... AI tools ... affect the productivity of experienced > open-source developers. 16 developers with moderate AI > experience complete 246 tasks in mature projects on which they > have an average of 5 years of prior experience. Each task is > randomly assigned to allow or disallo…

it doesnt control for skill using models/experience using models. this looks VERY different at hour 1000 and hour 5000 than hour 100.

Re: Writing a good Claude.md

#155
I've been a customer since sonnet 3.5. It is coming to the point where opus 4.5 usually does better than whatever your instructions say on claude.md just by reading your code and having a general sense of what your preferences are.

I used to instruct about coding style (prefer functions, avoid classes, use structs for complex params and returns, avoid member functions unless needed by shared state, avoid superfluous comments, avoid silly utf8 glyphs, AoS vs SoA, dry, etc)

I removed all my instructions and it basically never violates those points.

Re: Writing a good Claude.md

#156
post #64

Oh yeah I added a CLAUDE.md to my project the other day: https://github.com/grishka/Smithereen/blob/master/CLAUDE.md Is it a good one?

Definitely a good one - probably one of the best CLAUDE.md files you can put in any repository if you care about your project at all.

Re: Writing a good Claude.md

#157

Earlier quoted context omitted.

I suspect you’re misjudging the friend here. This sounds more like the famous “no brown m&ms” clause in the Van Halen performance contract. As ridiculous as the request is, it being followed provides strong evidence that the rest (and more meaningful) of the requests are. Sounds like the friend understands quite well how LLMs actually work and has found a clever way to be signaled when it’s starting to go off the rai…

It's also a common tactic for filtering inbound email. Mention that people may optionally include some word like 'orange' in the subject line to tell you they've come via some place like your blog or whatever it may be, and have read at least carefully enough to notice this. Of course ironically that trick's probably trivially broken now because of use of LLMs in spam. But the point stands, it's an old trick.

Apart from the fact that not even every human would read this and add it to the subject, this would still work.

I doubt there is any spam machine out there the quickly tries to find peoples personal blog before sending them viagra mail.

If you are being targeted personally, then of course all bets are off, but that would’ve been the case with or without the subject-line-trick

Re: Writing a good Claude.md

#158
post #136

Earlier quoted context omitted.

> I suspect you’re misjudging the friend here. This sounds more like the famous “no brown m&ms” clause in the Van Halen performance contract. As ridiculous as the request is, it being followed provides strong evidence that the rest (and more meaningful) of the requests are. I'd argue, it's more like you've bought so much into the idea this is reasonable, that you're also willing to go through extreme lengths to recon…

It is kind of wild that not that long ago the general sentiment in software engineering (at least as observed on boards like this one) seemed to be about valuing systems that were understandable, introspectable, with tight feedback loops, within which we could compose layers of abstractions in meaningful and predictable ways (see for example the hugely popular - at the time - works of Chris Granger, Bret Victor, etc)…

You don’t think people are trying very hard to understand LLMs? We recognize the value of interpretability. It is just not an easy task.

It’s not the first time in human history that our ability to create things has exceeded our capacity to understand.

Re: Writing a good Claude.md

#159
post #82

> Claude often ignores CLAUDE.md > The more information you have in the file that's not universally applicable to the tasks you have it working on, the more likely it is that Claude will ignore your instructions in the file Claude.md files can get pretty long, and many times Claude Code just stops following a lot of the directions specified in the file A friend of mine tells Claude to always address him as “Mr Tinkle…

The article explains why that's not a very good test however.

Why not? It's relevant for all tasks, and just adds 1 line

Re: Writing a good Claude.md

#160

"You can investigate this yourself by putting a logging proxy between the claude code CLI and the Anthropic API using ANTHROPIC_BASE_URL" I'd be eager to read a tutorial about that I never know which tool to favour for doing that when you're not a system or network expert.

Have you considered just asking claude? I'd wager you'd get up and running in <10 minutes.

AI is good for discovery but not validation, I wanted experienced human feedback here
Post reply on HN