Skip to main content
commandsSource-backedReview first Safety Privacy

Bootstrap CLAUDE.md with /init in Claude Code

Use the built-in /init command to generate a project CLAUDE.md from your codebase, then refine it by hand. Covers /memory, file locations, @path imports, and .claude/rules/.

by JSONbored·added 2025-10-25·
HarnessClaude Code
Invocation:/init
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://code.claude.com/docs/en/slash-commands, https://github.com/JSONbored/awesome-claude/blob/main/content/commands/claudemd-builder.mdx
Safety notes
/init writes a CLAUDE.md file to your project (and, in the CLAUDE_CODE_NEW_INIT=1 flow, may also propose skills and hooks). It analyzes your codebase before writing; review the generated file before committing., CLAUDE.md, CLAUDE.local.md, and .claude/rules/ are loaded into Claude's context every session as behavioral guidance, not enforced configuration. For hard enforcement (blocking tools/commands), use a PreToolUse hook or managed settings instead., Custom commands in .claude/commands/*.md are prompt templates committed to the repo and run with your session's permissions; review any command file before invoking it.
Privacy notes
CLAUDE.md and .claude/rules/ are committed to source control and shared with your team, so do not put secrets, credentials, or sensitive data in them. Use CLAUDE.local.md (gitignored) for personal, machine-local notes., /init reads files across your project (and existing AGENTS.md/.cursorrules/.windsurfrules) to generate context; do not let it copy secret values into the generated CLAUDE.md., Auto memory is stored locally under ~/.claude/projects/<project>/memory/ and is machine-local; review it with /memory if you are concerned about what was recorded.
Author
JSONbored
Claim status
unclaimed
Last verified
2025-10-25

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

78

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Complete

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    Registry metadata indicates a reviewed listing.

    Done

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

Copy & paste

Copy-ready — paste the snippet to get started.

Install command

Not provided

Config snippet

Not provided

Copy snippet

Provided

Prerequisites

None

Platforms

1 listed

Difficulty

100/100

Adoption plan

Balanced adoption plan

Current risk score 16/100. Use staged verification before broader rollout.

Risk 16

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    Listing has review metadata.

    Done
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Required evidence gates are covered (5/6 signals complete).

Risk 15

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Present

Review metadata is present.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required evidence gates are covered for this preset.

Decision timeline

Decision timeline · balanced

5/6 steps complete with no blocking gaps for this preset.

Risk 14

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is available.

Done

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

No required blockers for this timeline preset.

Safety & privacy surface

Safety & privacy surface

3 safety and 3 privacy notes across 3 risk areas. Review closely: credentials & tokens.

3 areas
  • SafetyLocal files/init writes a CLAUDE.md file to your project (and, in the CLAUDE_CODE_NEW_INIT=1 flow, may also propose skills and hooks). It analyzes your codebase before writing; review the generated file before committing.
  • SafetyCredentials & tokensCLAUDE.md, CLAUDE.local.md, and .claude/rules/ are loaded into Claude's context every session as behavioral guidance, not enforced configuration. For hard enforcement (blocking tools/commands), use a PreToolUse hook or managed settings instead.
  • SafetyCredentials & tokensCustom commands in .claude/commands/*.md are prompt templates committed to the repo and run with your session's permissions; review any command file before invoking it.
  • PrivacyCredentials & tokensCLAUDE.md and .claude/rules/ are committed to source control and shared with your team, so do not put secrets, credentials, or sensitive data in them. Use CLAUDE.local.md (gitignored) for personal, machine-local notes.
  • PrivacyCredentials & tokens/init reads files across your project (and existing AGENTS.md/.cursorrules/.windsurfrules) to generate context; do not let it copy secret values into the generated CLAUDE.md.
  • PrivacyData retentionAuto memory is stored locally under ~/.claude/projects/<project>/memory/ and is machine-local; review it with /memory if you are concerned about what was recorded.

Safety notes

  • /init writes a CLAUDE.md file to your project (and, in the CLAUDE_CODE_NEW_INIT=1 flow, may also propose skills and hooks). It analyzes your codebase before writing; review the generated file before committing.
  • CLAUDE.md, CLAUDE.local.md, and .claude/rules/ are loaded into Claude's context every session as behavioral guidance, not enforced configuration. For hard enforcement (blocking tools/commands), use a PreToolUse hook or managed settings instead.
  • Custom commands in .claude/commands/*.md are prompt templates committed to the repo and run with your session's permissions; review any command file before invoking it.

Privacy notes

  • CLAUDE.md and .claude/rules/ are committed to source control and shared with your team, so do not put secrets, credentials, or sensitive data in them. Use CLAUDE.local.md (gitignored) for personal, machine-local notes.
  • /init reads files across your project (and existing AGENTS.md/.cursorrules/.windsurfrules) to generate context; do not let it copy secret values into the generated CLAUDE.md.
  • Auto memory is stored locally under ~/.claude/projects/<project>/memory/ and is machine-local; review it with /memory if you are concerned about what was recorded.

Schema details

Install type
copy
Reading time
10 min
Difficulty score
100
Troubleshooting
Yes
Breaking changes
No
Skill and platform metadata
Retrieval sources
https://code.claude.com/docs/en/slash-commandshttps://code.claude.com/docs/en/memoryhttps://code.claude.com/docs/en/claude-md
Runtime and command metadata
Command syntax
/init
Full copyable content
/init

About this resource

There is no /claudemd-builder command in Claude Code. The built-in command that bootstraps a project CLAUDE.md is /init. This page describes the real, documented workflow for creating and maintaining CLAUDE.md memory files.

What /init does

Run /init inside a project and Claude analyzes your codebase, then generates a starting CLAUDE.md containing build commands, test instructions, and the project conventions it discovers. From there you refine the file by hand with instructions Claude would not find on its own.

  • If a CLAUDE.md already exists, /init suggests improvements rather than overwriting it.
  • If the repo already has an AGENTS.md, /init reads it and incorporates the relevant parts into the generated CLAUDE.md. It also reads other tool configs like .cursorrules, .devin/rules/, and .windsurfrules.
/init

Interactive multi-phase flow (opt-in)

Set the environment variable CLAUDE_CODE_NEW_INIT=1 to enable an interactive flow. In this mode /init asks which artifacts to set up (CLAUDE.md files, skills, and hooks), explores your codebase with a subagent, fills gaps with follow-up questions, and presents a reviewable proposal before writing any files.

CLAUDE_CODE_NEW_INIT=1 claude
# then, inside the session:
/init

/init takes no flags such as --template, --validate, or --hierarchy. Those do not exist. You shape the output by editing the generated file and re-running /init to get improvement suggestions.

Where CLAUDE.md files live

CLAUDE.md files can live in several locations, loaded from broadest scope to most specific:

Scope Location Shared with
Managed policy /Library/Application Support/ClaudeCode/CLAUDE.md (macOS), /etc/claude-code/CLAUDE.md (Linux/WSL), C:\Program Files\ClaudeCode\CLAUDE.md (Windows) All users on the machine
User instructions ~/.claude/CLAUDE.md Just you, all projects
Project instructions ./CLAUDE.md or ./.claude/CLAUDE.md Team, via source control
Local instructions ./CLAUDE.local.md (gitignore it) Just you, this project

Files in the directory hierarchy above the working directory load in full at launch. Files in subdirectories load on demand when Claude reads files in those directories. Across the tree, content is concatenated (not overridden), ordered from the filesystem root down to your working directory, so the most specific instructions are read last. Aim for under ~200 lines per file; longer files consume more context and reduce adherence.

Splitting and importing

CLAUDE.md files can pull in other files with @path/to/import syntax. Imported files are expanded into context at launch. Both relative and absolute paths work; imports can recurse up to four hops.

See @README for project overview and @package.json for npm commands.

# Additional Instructions
- git workflow @docs/git-instructions.md

If you already keep guidance in AGENTS.md, create a CLAUDE.md that imports it so both tools read one source of truth:

@AGENTS.md

## Claude Code
Use plan mode for changes under `src/billing/`.

Path-scoped rules with .claude/rules/

For larger projects, split instructions into .claude/rules/*.md. Rules without paths frontmatter load every session with the same priority as .claude/CLAUDE.md. Rules with a paths field load only when Claude works with matching files:

---
paths:
  - "src/api/**/*.ts"
---

# API Development Rules
- All API endpoints must include input validation
- Use the standard error response format

This is the documented way to get directory- or filetype-specific context, in place of the fictional --hierarchy flag.

Inspecting loaded memory with /memory

/memory lists every CLAUDE.md, CLAUDE.local.md, and rules file loaded in the current session, lets you toggle auto memory, and opens the auto memory folder. Use it to confirm a file is actually being loaded when an instruction is being ignored, and to open any file in your editor.

/memory

A custom command alternative

If you want a repeatable, project-specific routine for editing CLAUDE.md (for example, "audit CLAUDE.md against the current stack and propose updates"), create a custom command, which is a user-authored file, not a built-in. Custom commands have been merged into skills: a file at .claude/commands/<name>.md and a skill at .claude/skills/<name>/SKILL.md both create /<name> and work the same way. Existing .claude/commands/ files keep working.

mkdir -p .claude/commands
cat > .claude/commands/refresh-claude-md.md <<'EOF'
Review the project's CLAUDE.md against the current dependencies in package.json
and the directory layout. Propose concise updates to build/test commands,
conventions, and architecture notes. Keep the file under 200 lines and do not
add secrets or frequently changing data.
EOF

Invoke it with:

/refresh-claude-md

This is a normal prompt template you maintain yourself. It has no special flags and no guaranteed behavior beyond the instructions you write in the file.

What to put in CLAUDE.md

Keep it to facts Claude should hold every session: build and test commands, naming and code-style conventions, project layout, and "always do X" rules. Move multi-step procedures into a skill, and move filetype-specific guidance into a path-scoped rule. Do not store secrets, credentials, or data that changes often.

When to use which

  • Bootstrapping a new repo or a repo with no CLAUDE.md: run /init.
  • Improving an existing CLAUDE.md: run /init for suggestions, then edit by hand.
  • Verifying which instruction files load: run /memory.
  • A repeatable editing routine: a custom .claude/commands/*.md command.

Notes on accuracy

The original version of this entry documented a /claudemd-builder command with --init, --template, --update, --validate, --hierarchy, and template/scope flags. None of those exist in Claude Code. Use /init, /memory, @path imports, and .claude/rules/ as documented above.

Source citations

Add this badge to your README

Show that Bootstrap CLAUDE.md with /init in Claude Code is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/commands/claudemd-builder.svg)](https://heyclau.de/entry/commands/claudemd-builder)

How it compares

Bootstrap CLAUDE.md with /init in Claude Code side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

Next steps differ across entries — use the actions in the table below to copy install commands and source links per resource.

Field

Use the built-in /init command to generate a project CLAUDE.md from your codebase, then refine it by hand. Covers /memory, file locations, @path imports, and .claude/rules/.

Open dossier

Intelligent code explanation with visual diagrams, step-by-step breakdowns, and interactive examples

Open dossier

Claude Code slash command that generates a new .claude/commands/*.md file from a template, with optional arguments, frontmatter, and team-sharing support.

Open dossier

Advanced debugging assistant with root cause analysis, step-by-step troubleshooting, and automated fix suggestions

Open dossier
Next stepsDiffers
Trust
Review statusReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verifiedPackage not verified
Source provenanceSource-backedSource-backedSource-backedSource-backed
Submitter
Install riskReview firstReview firstReview firstReview first
Notes Safety Privacy Safety Privacy Safety Privacy Safety Privacy
Brand
Categorycommandscommandscommandscommands
Sourcesource-backedsource-backedsource-backedsource-backed
AuthorJSONboredJSONboredJSONboredJSONbored
Added2025-10-252025-09-162025-10-252025-09-16
Platforms
Claude Code
Claude Code
Claude Code
Claude Code
Source repo
Safety notes/init writes a CLAUDE.md file to your project (and, in the CLAUDE_CODE_NEW_INIT=1 flow, may also propose skills and hooks). It analyzes your codebase before writing; review the generated file before committing. CLAUDE.md, CLAUDE.local.md, and .claude/rules/ are loaded into Claude's context every session as behavioral guidance, not enforced configuration. For hard enforcement (blocking tools/commands), use a PreToolUse hook or managed settings instead. Custom commands in .claude/commands/*.md are prompt templates committed to the repo and run with your session's permissions; review any command file before invoking it.Review generated changes and commands before applying them; slash commands can ask the agent to read, write, edit, or run tools in the current project. Limit scope to the intended files and run in a trusted checkout when the command analyzes code, tests, security findings, or generated output.Creates .md files in .claude/commands/ in the current project directory; review generated content before committing.Review generated changes and commands before applying them; slash commands can ask the agent to read, write, edit, or run tools in the current project. Limit scope to the intended files and run in a trusted checkout when the command analyzes code, tests, security findings, or generated output.
Privacy notesCLAUDE.md and .claude/rules/ are committed to source control and shared with your team, so do not put secrets, credentials, or sensitive data in them. Use CLAUDE.local.md (gitignored) for personal, machine-local notes. /init reads files across your project (and existing AGENTS.md/.cursorrules/.windsurfrules) to generate context; do not let it copy secret values into the generated CLAUDE.md. Auto memory is stored locally under ~/.claude/projects/<project>/memory/ and is machine-local; review it with /memory if you are concerned about what was recorded.Prompts, source files, logs, errors, dependency metadata, and generated reports may be sent to the configured AI model during command execution. Redact secrets, customer data, private repository details, and proprietary code before sharing command output outside the workspace.Creates .md files in your local .claude/commands/ directory; no content is sent externally.Prompts, source files, logs, errors, dependency metadata, and generated reports may be sent to the configured AI model during command execution. Redact secrets, customer data, private repository details, and proprietary code before sharing command output outside the workspace.
Prerequisites— none listed— none listed— none listed— none listed
Install
/explain [options] <code_or_file>
/slash-command-gen [command-name] [options]
/debug
Config
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed
Open 4 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.