Claude Tips mascot
Claude Tips & Tricks
Claude Code beginner

Auto-Generate CLAUDE.md with /init

Run /init to have Claude Code automatically analyze your project and generate a CLAUDE.md file with your stack, conventions, and build commands.

Don’t want to write a CLAUDE.md by hand? Run /init and Claude will analyze your project and generate one automatically.

/init

Claude scans your repo and creates a CLAUDE.md with:

  • Tech stack detected from package.json, go.mod, requirements.txt, etc.
  • Build/test/lint commands found in scripts, Makefile, CI configs
  • Project structure overview of key directories
  • Coding conventions inferred from existing code patterns

When to Use /init

  • Starting Claude Code on an existing project for the first time
  • Onboarding a new team member who wants Claude to match the project’s style
  • After major refactors that changed the project structure

Tip: Review and Edit

The generated CLAUDE.md is a starting point. Review it and add project-specific details Claude can’t infer, like “never use ORM, always write raw SQL” or “all API responses must include request_id.”

Paste into Claude Code
/init