
What Does /init Do in Claude Code? (CLAUDE.md Setup Explained)
The /init command scans your project and generates a CLAUDE.md file — a persistent briefing that tells Claude your conventions, stack, and rules. Here's how to use it.
Every time you start a Claude Code session, it looks for a file called CLAUDE.md in your project root. This file is your project's instruction manual for Claude — coding standards, build commands, architecture decisions, testing requirements. The /init command creates this file automatically by scanning your codebase.
What does /init generate?
When you run /init, Claude Code crawls your project directory, reads the file structure, and generates a CLAUDE.md that typically includes:
- Build and test commands — how to run your project, lint, and test
- Architecture patterns — framework, router structure, state management
- Code conventions — naming patterns, file organization, import style
- Key dependencies — what libraries you're using and why
- Common workflows — deployment steps, PR process, CI/CD setup
Think of it like the "App Data" tab in Bubble — it's the metadata that describes how your project works, except Claude reads it at the start of every conversation so it doesn't have to re-discover everything each time.
How do you run /init?
Open Claude Code in your project root and type:
/init
Claude will scan your files and generate a CLAUDE.md. Review it, edit anything that's wrong or missing, and commit it to your repo.
The new conversational /init (2026)
In March 2026, /init got a major upgrade. Instead of just scanning files, it now asks you questions about your workflow — what recurring tasks could become skills, what operations should be blocked through hooks, and how your team prefers to work.
To enable the conversational version:
CLAUDE_CODE_NEW_INIT=1 claude
Then run /init as usual. The output is a more complete CLAUDE.md tailored to how you actually work, not just what's in your file tree.
Why does CLAUDE.md matter?
Without CLAUDE.md, Claude Code has to infer your conventions every session. It might:
- Use a different testing framework than your team uses
- Miss your preferred naming conventions
- Not know about your CI/CD requirements
- Suggest patterns that clash with your architecture
With a good CLAUDE.md, Claude starts every session already knowing the rules. It's the difference between onboarding a contractor with documentation versus telling them "just figure it out."
What should you add to CLAUDE.md after /init?
The auto-generated file is a starting point. Customize it with:
Coding standards your team cares about:
## Code Style
- Use named exports, not default exports
- Prefer const over let
- All API responses must use the ApiResponse<T> wrapper
Things Claude should never do:
## Rules
- NEVER delete migration files
- NEVER modify .env files
- Always run tests before suggesting a commit
Project-specific context:
## Architecture
- App Router (Next.js 16), not Pages Router
- Supabase for auth and database
- Tailwind CSS, no custom CSS files
Should you commit CLAUDE.md to version control?
Yes. Commit it to your repo so everyone on the team gets the same Claude experience. Claude Code also supports a hierarchy:
~/.claude/CLAUDE.md— personal preferences (applies to all projects)./CLAUDE.md— project root (shared with team via git)./src/CLAUDE.md— subdirectory overrides (for monorepo modules)
Claude loads all of them, with more specific files taking priority.
How often should you update CLAUDE.md?
Update it whenever you make architectural decisions, add new conventions, or notice Claude doing something wrong repeatedly. A good rule: if you correct Claude twice about the same thing, add it to CLAUDE.md so it doesn't happen again.