Command reference ยท Claude Code
/init
Initializes the project with a CLAUDE.md guide.
/init analyzes the current repository and creates a starter CLAUDE.md with build commands, testing instructions, and project conventions that Claude discovers in the code. If a CLAUDE.md already exists, the command does not overwrite it but instead suggests targeted improvements.
/init also automatically reads existing Cursor rules (.cursor/rules/ or .cursorrules) and Copilot rules (.github/copilot-instructions.md) and incorporates relevant parts into the generated CLAUDE.md.
With the environment variable CLAUDE_CODE_NEW_INIT=1 set, an interactive multi-phase flow runs instead: Claude asks which artifacts to set up (CLAUDE.md, skills, hooks), explores the repo via a subagent, asks follow-up questions, and shows a proposal for approval before writing. In this mode, /init also reads AGENTS.md, .devin/rules/, .windsurf/rules/ or .windsurfrules, and .clinerules, and can create a private, uncommitted CLAUDE.local.md. Since version 2.1.108, Claude can also trigger /init itself via the Skill tool when needed.
โ WHEN TO USE IT?
Prepare a new repository for Claude Code
Run /init in a freshly cloned project so Claude creates an initial CLAUDE.md with project context.
Full setup including skills, hooks, and memory
Start /init with the environment variable CLAUDE_CODE_NEW_INIT=1 set to interactively set up skills, hooks, and personal memory files as well.
โ WHEN NOT TO?
Making only a targeted addition to an already well-maintained CLAUDE.md
According to the docs, /init does not overwrite an existing CLAUDE.md, only suggests improvements โ but for a single, clearly scoped change, the full analysis run is still an unnecessary detour.
Better: Edit CLAUDE.md directly with /memory.
Adding only private, non-versioned preferences
Personal settings belong in a gitignored CLAUDE.local.md; without CLAUDE_CODE_NEW_INIT=1, /init doesn't set this up automatically.
Better: Create CLAUDE.local.md manually and add it to .gitignore.
SOURCES
- Claude Code docs (official) โ code.claude.com
MORE COMMANDS ยท Claude Code