init — Project Initialization
- Trigger:
/initor keywords "initialize project", "create CLAUDE.md" - Best for: Onboarding projects to Claude Code, documenting existing projects
- Not for: Updating existing CLAUDE.md (edit directly)
Overview
init analyzes the current project and generates a CLAUDE.md file — the core entry point for Claude Code to understand your project. It covers architecture, tech stack, conventions, and key file paths.
Trigger Conditions
init auto-triggers when you:
- Mention "initialize", "init project"
- Want to onboard a new project to Claude Code
- Use the
/initcommand
Examples
Example 1: Initialize New Project
/initClaude scans the project and generates a CLAUDE.md:
markdown
# Project Name
## Architecture
- Monorepo with pnpm workspaces
- Frontend: React + TypeScript
- Backend: Node.js + Express
## Key Directories
- `packages/web/` — Frontend app
- `packages/api/` — Backend API
- `packages/shared/` — Shared types and utils
## Conventions
- Use functional components, no class components
- API routes follow RESTful conventions
- Tests colocated with source filesExample 2: Specify Tech Stack
/init This is a Next.js 14 + Prisma + PostgreSQL project using App RouterExample 3: Python Project
/init FastAPI backend project using SQLAlchemy + AlembicCLAUDE.md Content
| Section | Description |
|---|---|
| Architecture | Project architecture overview |
| Tech Stack | Technologies and versions |
| Key Directories | Core directory descriptions |
| Conventions | Code conventions and standards |
| Commands | Common commands (build, test, deploy) |
| Gotchas | Pitfalls and exceptions to note |
Notes
- CLAUDE.md should be concise — it's not a README replacement
- Avoid overly detailed API docs — Claude can learn from the code
- Conventions and gotchas are the most valuable parts — teach Claude what's counterintuitive
- Review and edit the initial generation for accuracy
initwon't overwrite an existing CLAUDE.md
Related Skills
- improve-codebase-architecture — Improve project architecture
- write-a-skill — Create project-specific Skills