Demo, all content is generated
Question

What is CLAUDE.md and do I have to make it myself?

Solved · 3303 views · asked by hugo_l · edited

Everyone mentions CLAUDE.md. I've been using Claude Code for 2 weeks without one. Does it do anything special or is it just a readme? Do I write it or does Claude?

What I’ve tried

Searched my project, there's no such file. Looked in the settings, nothing there either.

Comment

3 answers

Marked as helpful by the asker
jonas_k · edited

It's a file Claude Code automatically reads at the start of every session. Anything in it is basically part of every prompt, so you don't have to repeat yourself.

Create it with /init inside Claude Code: it scans your project and writes a first version. Then edit it yourself. Good things to put in:

  • What the app is, in two sentences.
  • Stack and important versions.
  • Commands: how to run, test, build.
  • Rules you keep repeating ("use the server client in app/", "never edit migrations that already ran").

Keep it short. Every line costs context in every session, and a long file gets followed less.

There's also ~/.claude/CLAUDE.md for personal preferences across all projects.

Comment
/init made a pretty good one. Can't believe I went 2 weeks without. hugo_l · edited
Good summary. I'd add: commit it to git, so it evolves with the project. rafa_dev · edited
Same, 2 weeks here too. Thanks for the clear answer. bakery_bo · edited
felix_codes · edited

Tip: when you catch yourself correcting Claude on the same thing twice, that's a line for CLAUDE.md.

Comment
Good rule of thumb, added two lines already. hugo_l · edited
mira_dev · edited

You can also put CLAUDE.md files in subfolders (like supabase/CLAUDE.md for migration rules). They get pulled in when Claude works on files in that folder, so the root file stays small.

Comment