Lv.1 0 XP

CLAUDE.md and Version Control — What Gets Committed and Why

Core 7 min +30 XP
💡
THE ANALOGY

A shared employee handbook vs a personal notebook. The handbook (project-level CLAUDE.md) is published, applies to everyone, and updates go through review. Your personal notebook (user-level) is yours alone. You wouldn't put your personal passwords in the company handbook — and you wouldn't expect colleagues to follow rules only in your personal notebook.

⚠️ EXAM TRAP — The Wrong Answer People Choose

Including sensitive information (API keys, credentials, personal paths) in project-level CLAUDE.md. This gets committed to git and shared with everyone who clones the repo — potentially including external contributors.

KEY POINTS
1 Project-level and directory-level CLAUDE.md files SHOULD be committed — they are team assets.
2 User-level ~/.claude/CLAUDE.md should NEVER be committed — add to .gitignore if needed.
3 Never put credentials, personal API keys, local paths, or personal preferences in project-level files.
4 CLAUDE.md should be treated like other team documentation — reviewed, kept up to date, reflects actual team practices.
5 The .claude/ directory at project root may contain CLAUDE.md and settings.json — both should generally be committed.