#055

/init in Claude Code: way more than a CLAUDE.md template

By default `/init` generates a basic CLAUDE.md. With `CLAUDE_CODE_NEW_INIT=1` you unlock an interactive flow that also scaffolds skills and hooks by analyzing your repo, applying the rule "only include what Claude wouldn't infer on its own."

From zero to professional: Claude Code tips, tutorials and deep dive guides.

Explore the hub

The two modes of /init: default generates a basic CLAUDE.md; with CLAUDE_CODE_NEW_INIT=1 it scaffolds a minimal CLAUDE.md + skills + hooks

TL;DR By default /init generates a basic CLAUDE.md. With CLAUDE_CODE_NEW_INIT=1 you unlock an interactive flow that also scaffolds skills and hooks by analyzing your repo, applying the rule "only include what Claude wouldn't infer on its own."

/init is one of those built-in commands almost everyone runs once on day one and never again. And they're stuck with the poor mode: a generic CLAUDE.md that Anthropic itself considers deprecated under its current philosophy ("CLAUDE.md is loaded into every Claude Code session, so it must be concise — only include what Claude would get wrong without it").

The new flow goes further: it can also generate the project's first skills and hooks. More importantly, it applies discipline on CLAUDE.md from day one. If your CLAUDE.md is already full of junk, re-running /init with the new flow is the cleanest way to start over.

How it works internally

When you run /init, Claude Code loads one of two prompts depending on CLAUDE_CODE_NEW_INIT:

Mode Variable Description What it generates
Default (unset) "Initialize a new CLAUDE.md file with codebase documentation" Basic CLAUDE.md + note about /plugin
New CLAUDE_CODE_NEW_INIT=1 "Initialize new CLAUDE.md file(s) and optional skills/hooks with codebase documentation" Minimal CLAUDE.md + skills (optional) + hooks (optional)

The new mode is governed by a literal rule in the prompt: "CLAUDE.md is loaded into every Claude Code session, so it must be concise — only include what Claude would get wrong without it." That means: don't list package.json dependencies, folder structure, or language conventions — Claude infers those.

How to enable it

For a single session:

CLAUDE_CODE_NEW_INIT=1 claude

Then inside the session:

/init

Permanently in your shell:

echo 'export CLAUDE_CODE_NEW_INIT=1' >> ~/.zshrc

When to re-run it

/init is not "once and forget":

  • Major refactor: if you moved code to a monorepo, switched frameworks, or introduced new skills, re-init so CLAUDE.md and the hooks reflect the new state.
  • After removing deprecated code: if your CLAUDE.md describes a module that no longer exists, regenerating is cleaner than patching.
  • Before onboarding: a clean CLAUDE.md on day one shortens the ramp for new developers.

Bonus: /init-verifiers

There's a sibling command almost nobody knows about:

/init-verifiers

Generates skills specifically for automated verification of code changes. Useful when you want certain checks (linter, specific tests, type validation) to run consistently as auto-invocable skills after each edit.

Reference

Command Use it for
/init (default) Basic CLAUDE.md generated from automatic analysis
CLAUDE_CODE_NEW_INIT=1 + /init Minimal CLAUDE.md + skills + hooks
/init-verifiers Post-edit verification skills

Official docs: Claude Code commands

Get only what matters

If I have nothing worth saying, you won't hear from me. When I do, you'll be the first to know. 7,000+ professionals already trust this.

Are you a professional Web developer?
No

Unsubscribe at any time.