brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: /init writes a first CLAUDE.md for your project in Claude Code

Claude
~/tips/tip-claude-init-claude-md

/init

Lets Claude scan the repository and draft the project instructions file for you.

A new repository has no CLAUDE.md, so every session starts by rediscovering how to build and test it. One command gives you a first draft.

/init

Claude analyses the codebase and writes a CLAUDE.md with the build commands, test instructions and conventions it finds. If the file already exists, /init suggests improvements instead of overwriting it, so it’s safe to run again on an older project.

For a guided version, start Claude Code with an environment variable:

CLAUDE_CODE_NEW_INIT=1 claude

Then /init asks what to set up, CLAUDE.md files, skills and hooks, explores the code with a subagent, asks follow-up questions and shows a proposal before it writes anything. That flow can also create a personal CLAUDE.local.md and add it to .gitignore.

In my view the result is a draft. Go through it, cut what Claude would find anyway by reading the code, and add what it can’t know: why a folder is off limits, which test is slow, what the team agreed on. The docs suggest keeping a CLAUDE.md under about 200 lines, because a longer file costs context in every session and gets followed less well.

Further reading: How Claude remembers your project, Commands

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link