Lesson

CLAUDE.md Initialization and Best Practices in Claude Code

Generate a living `CLAUDE.md` for your repo, keep it fresh in conversation, and layer in private notes via file references.

Access
Included
Transcript
Needs source

CLAUDE.md initialization primes Claude Code with a single, evolving source of truth. Use it to record team guidance, keep updates flowing, and separate shared memory from personal notes.

Generate CLAUDE.md

Initialize from the codebase:

/init

Keep it fresh

  • Temporarily allow edits:

    claude --permission-mode acceptEdits
    
  • Update conversationally:

    Update the build section to use pnpm instead of npm.
    

Layer private context with file references

Add references in CLAUDE.md:

@~/.claude/info.md
@./.claude/common-commands.md

Example personal file:

# ~/.claude/info.md
Favorite Pizza: Turkey

To permit reading your user file, grant access in your user settings:

{
  "permissions": {
    "allow": ["Read((/Users/you/.claude/**))"]
  }
}

Patterns that scale

  • Keep team-wide instructions in CLAUDE.md.
  • Keep individual notes out of the repo via @~/.claude/....
  • Break large docs into referenced modules for faster updates.

You’ve finished the series. You can now set up Claude Code, work fast, scale context, manage costs, secure secrets, collaborate via settings, and maintain living project memory.