Anatomy of the .claude/ Folder
Everything Claude needs to know about your project lives right here.
Two config locations.
your-project/.claude/ for team config (committed to git). ~/.claude/ for personal config (never committed). Both load on every session.
1Project Structure
CLAUDE.md
Write
- Build commands
- Architecture notes
- Gotchas & conventions
Don't write
- Linter configs
- Long docs
- Theory paragraphs
rules/
Split your crowded CLAUDE.md into focused files. Each file = one concern.
Use paths: src/api/**/*.ts to only load when Claude works in matching folders.
skills/
agents/
2Hooks - Deterministic Control
PreToolUse
Block dangerous commands before they run
PostToolUse
Auto-format files after every edit
Stop
Ensure tests pass before completing
exit 1 for security = most common mistake!
3settings.json
Allow
Deny
Not in either list? Claude asks first.
4Precedence
On conflict, the more specific layer overrides the general one.
.claude/rules/path-scoped overridesCLAUDE.local.mdpersonal, gitignoredCLAUDE.mdproject / team, in git~/.claude/CLAUDE.mdglobal fallback defaults5Get Started in 5 Steps
Run /init and edit CLAUDE.md down to essentials
Add settings.json with allow/deny rules
Create 1-2 custom commands/ for common workflows
Split crowded CLAUDE.md into rules/ files
Add ~/.claude/CLAUDE.md for personal preferences
CLAUDE.md is your highest-leverage file. Get that right first. Everything else is optimization.
AI TopiaWant Claude to work like a senior teammate?
Get the full setup walkthrough and more Claude Code resources.