Live data from Hacker News

Writing a good Claude.md

humanlayer.dev

81–90 of 304 posts

Re: Writing a good Claude.md

#81

Probably a lot of people here disagree with this feeling. But my take is that if setting up all the AI infrastructure and onboarding to my code is going to take this amount of effort, then I might as well code the damn thing myself which is what I'm getting paid to (and enjoy doing anyway)

A lot of the style stuff you can write once and reuse. I started splitting mine into overall and project specific files for this reason

Universal has stuff I always want (use uv instead of pip etc) while the other describes what tech choice for this project

Re: Writing a good Claude.md

#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 Tinkleberry”, he says he can tell Claude is not paying attention to the instructions on Claude.md, when Claude stops calling him “Mr Tinkleberry” consistently

Re: Writing a good Claude.md

#83
post #8

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…

> Claude.md

It’s case sensitive btw. CLAUDE.md - Might explain your mixed results with it

Re: Writing a good Claude.md

#84

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

Just install mitmproxy. Takes like 5 mins to figure out. 2 with Claude.

On phone else I’d post commands

Re: Writing a good Claude.md

#88
I have Claude itself write CLAUDE.md. Once it is informed of its context (e.g., "README.md is for users, CLAUDE.md is for you") you can say things like, "update readme and claudemd" and it will do it. I find this especially useful for prompts like, "update claudemd to make absolutely certain that you check the API docs every single time before making assumptions about its behavior" — I don't need to know what magick spell will make that happen, just that it does happen.

Re: Writing a good Claude.md

#89

I have Claude itself write CLAUDE.md. Once it is informed of its context (e.g., "README.md is for users, CLAUDE.md is for you") you can say things like, "update readme and claudemd" and it will do it. I find this especially useful for prompts like, "update claudemd to make absolutely certain that you check the API docs every single time before making assumptions about its behavior" — I don't need to know what magick…

Do you have any proof that AI written instructions are better than human ones? I don't see why an AI would have an innate understanding on how best to prompt itself.
Post reply on HN