Omniscio

OmniscioGuidesClaude Code /init

Claude Code /init: what the command writes, and what it leaves to you

A new repository has no instructions file, and writing one by hand from a blank file is the slow way to start. /init is the command that reads the code first, writes down what it found, and hands you a draft to correct.

This page owns the command and what it produces. Where CLAUDE.md files live, what loads and why one stops loading is the memory guide, and what a finished file should contain is the CLAUDE.md examples guide.

Sources read November 25, 2026. By the Omniscio team. Updated .

What /init writes

Run /init to generate a starting CLAUDE.md automatically. Claude analyzes your codebase and creates a file with the build commands, test instructions and project conventions it discovers.

The file lands in the project as ./CLAUDE.md or ./.claude/CLAUDE.md, the two places a project CLAUDE.md can sit. Either one loads for anyone who works in that project, which is why the next step is to read it rather than to trust it.

/init

What it cannot do is know the things a codebase does not say. Anthropic's own advice is to refine from there with the instructions Claude would not discover on its own.

Claude can also run it for you: /init is one of the few built-in commands available to Claude through the Skill tool, so asking Claude to set the project up reaches the same command.

Anthropic's first-session-in-a-repo guidance starts with /init, then /memory, which opens the CLAUDE.md files for editing and manages auto memory, to refine what it wrote.

What to do with the file it wrote

Treat the generated file as a first draft. Anthropic is explicit that Claude treats CLAUDE.md files as context, not enforced configuration, so what it wrote is guidance to follow rather than a rule the machine applies. A convention Claude inferred from the code is a description of what the code does today, not a rule about what it should do.

Then refine it with /memory, which edits the file in place, and add the instructions only you know: which branch to work on, what never to touch, how to run the one slow test suite. The CLAUDE.md examples guide shows what those look like for four stacks.

When a CLAUDE.md already exists

Running /init in a repository that already has a CLAUDE.md does not overwrite it. Claude suggests improvements instead, so a rerun leaves the existing file in place.

Read the suggestions before acting on them. A file that has been edited by hand carries decisions Claude cannot see, and /init is working from the code, not from the reasons behind it.

The interactive flow

Without the variable, /init generates a CLAUDE.md automatically without prompting. Set CLAUDE_CODE_NEW_INIT to 1 before you run /init for an interactive flow that also walks through skills, hooks and personal memory files. Set it in your shell or in the env block of a settings file.

export CLAUDE_CODE_NEW_INIT=1

With the variable set, /init asks which artifacts to set up (CLAUDE.md files, skills and hooks), explores your codebase with a subagent, fills in gaps with follow-up questions, and presents a reviewable proposal before writing any files.

The variable only changes how /init runs, so you can leave it set. One of the options it adds is a personal file: with it set, running /init and choosing the personal option creates CLAUDE.local.md and adds it to .gitignore for you. The ignore files guide covers why that matters.

The rules it carries over from other tools

Running /init reads other tools' instruction files and incorporates the relevant parts into the generated CLAUDE.md: Cursor rules in .cursor/rules/ or .cursorrules, and Copilot rules in .github/copilot-instructions.md.

With CLAUDE_CODE_NEW_INIT=1 set, the list grows: AGENTS.md, .devin/rules/, .windsurf/rules/ or .windsurfrules, and .clinerules.

The separate /import command goes further. It brings a supported coding agent's configuration into Claude Code, from OpenAI Codex, Google Gemini CLI or Cursor, appending a one-time copy of instruction files such as AGENTS.md to the matching CLAUDE.md and carrying over MCP servers, commands, subagents and skills.

The two work together: if /init finds OpenAI Codex or Google Gemini CLI configuration, it offers to carry it over with /import. Importing from Cursor requires Claude Code v2.1.265 or later, and /import is not available on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry or Claude Platform on AWS, through a Claude apps gateway, or when feature-flag fetching is turned off.

Sources

Every documented behavior on this page rests on one of these; the advice about how to use the result is ours. The date beside each one is the day we read it.

  • How Claude remembers your project, for what /init writes, the existing-file behavior, CLAUDE_CODE_NEW_INIT, the personal option, /memory and the other tools it reads. Read November 25, 2026.
  • Commands, for the /init and /import entries, the Codex and Gemini offer, and the first-session advice. Read November 25, 2026.
  • Extend Claude with skills, for /init being available through the Skill tool. Read November 25, 2026.
  • Environment variables, for CLAUDE_CODE_NEW_INIT and the fact that a default /init run does not prompt. Read November 25, 2026.

No /init run was performed for this page. Every behavior and option is transcribed from those pages.

Common questions

What does /init do in Claude Code?

/init initializes the project with a CLAUDE.md guide. Claude analyzes the codebase and creates a file with the build commands, test instructions and project conventions it discovers.

Does /init overwrite an existing CLAUDE.md?

No. If a CLAUDE.md already exists, /init suggests improvements rather than overwriting it.

What is CLAUDE_CODE_NEW_INIT?

It makes /init interactive. With it set to 1, /init asks which artifacts to set up, including CLAUDE.md files, skills and hooks, explores the codebase with a subagent, fills gaps with follow-up questions, and presents a reviewable proposal before writing any files.

Does /init read Cursor rules?

Yes. /init reads Cursor rules in .cursor/rules/ or .cursorrules and Copilot rules in .github/copilot-instructions.md, and incorporates the relevant parts into the generated CLAUDE.md. With CLAUDE_CODE_NEW_INIT=1 it also reads AGENTS.md, .devin/rules/, .windsurf/rules/ or .windsurfrules, and .clinerules.

What is the difference between /init and /import?

/init generates your CLAUDE.md. /import brings another agent's configuration into Claude Code: a one-time copy of instruction files such as AGENTS.md, plus MCP servers, commands, subagents and skills. It also covers OpenAI Codex and Google Gemini CLI configuration.

Start the project once, in one place

Omniscio runs several agent sessions side by side in one window, all reading the same project and the same project instructions. Any model, any harness: Claude Code, Codex, OpenCode, Devin, Pi, and Hermes all supported.