| ▲ | Writing a Good Claude.md(humanlayer.dev) | ||||||||||||||||||||||
| 66 points by objcts 3 hours ago | 17 comments | |||||||||||||||||||||||
| ▲ | _pdp_ 8 minutes ago | parent | next [-] | ||||||||||||||||||||||
There is far much easier way to do this and one that is perfectly aligned with how these tools work. It is called documenting your code! Just write what this file is supposed to do in a clear concise way. It acts as a prompt, it provides much needed context specific to the file and it is used only when necessary. Another tip is to add README.md files where possible and where it helps. What is this folder for? Nobody knows! Write a README.md file. It is not a rocket science. What people often forget about LLMs is that they are largely trained on public information which means that nothing new needs to be invented. You don't have to "prompt it just the right way". What you have to do is to use the same old good best practices. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | candiddevmike 7 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
None of this should be necessary if these tools did what they say on the tin, and most of this advice will probably age like milk. Write readmes for humans, not LLMs. That's where the ball is going. | |||||||||||||||||||||||
| ▲ | rootusrootus a minute ago | parent | prev | next [-] | ||||||||||||||||||||||
[delayed] | |||||||||||||||||||||||
| ▲ | andersco 14 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
I have found enabling the codebase itself to be the “Claude.md” to be most effective. In other words, set up effective automated checks for linting, type checking, unit tests etc and tell Claude to always run these before completing a task. If the agent keeps doing something you don’t like, then a linting update or an additional test often is more effective than trying to tinker with the Claude.md file. Also, ensure docs on the codebase are up to date and tell Claude to read relevant parts when working on a task and of course update the docs for each new task. YMMV but this has worked for me. | |||||||||||||||||||||||
| ▲ | btbuildem 10 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
It seems overall a good set of guidelines. I appreciate some of the observations being backed up by data. What I find most interesting is how a hierarchical / recursive context construct begins to emerge. The authors' note of "root" claude.md as well as the opening comments on LLMs being stateless ring to me like a bell. I think soon we will start seeing stateful LLMs, via clever manipulation of scope and context. Something akin to memory, as we humans perceive it. | |||||||||||||||||||||||
| ▲ | prettyblocks 10 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
The advice here seems to assume a single .md file with instructions for the whole project, but the AGENTS.md methodology as supported by agents like github copilot is to break out more specific AGENTS.md files in the subdirectories in your code base. I wonder how and if the tips shared change assuming a flow with a bunch of focused AGENTS.md files throughout the code. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | jasonjmcghee 30 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
Interesting selection of models for the "instruction count vs. accuracy" plot. Curious when that was done and why they chose those models. How well does ChatGPT 5/5.1 (and codex/mini/nano variants), Gemini 3, Claude Haiku/Sonnet/Opus 4.5, recent grok models, Kimi 2 Thinking etc (this generation of models) do? | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | eric-burel 31 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
"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. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | vladsh 26 minutes ago | parent | prev [-] | ||||||||||||||||||||||
What is a good Claude.md? | |||||||||||||||||||||||
| |||||||||||||||||||||||