← Claude Code Hub
✦ Tip #055 Apr 29, 2026

/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."

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

/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

Free guide

51 tips to master Claude Code.

One page per tip. Five chapters. What I actually use daily in production — no theory, no fluff.

  • I. Getting started 10 tips
  • II. Awareness 3 tips
  • III. Mastery 22 tips
  • IV. Autonomy 10 tips
  • V. Comparison 6 tips
Are you a professional Web developer?

You'll receive the guide by email · You join the Gravitas newsletter · Unsubscribe anytime

of 51
#

Wmedia · 51 Tips
Free guide · 51 tips · 5 chapters

51 tips to master Claude Code.

Are you a professional Web developer? · Unsubscribe anytime