A complete guide to CLAUDE.md, custom commands, skills, agents, and permissions, and how to set them up properly.

---
Most Claude Code users treat the .claude folder like a black box. They know it exists. They've seen it appear in their project root. But they've never opened it, let alone understood what every file inside it does.
That's a missed opportunity.
The .claude folder is the control center for how Claude behaves in your project. It holds your instructions, your custom commands, your permission rules, and even Claude's memory across sessions. Once you understand what lives where and why, you can configure Claude Code to behave exactly the way your team needs it to.
This guide walks through the entire anatomy of the folder, from the files you'll use daily to the ones you'll set once and forget.
# Two folders, not one
Before diving in, one thing worth knowing upfront: there are actually two .claude directories, not one.
The first lives inside your project and the second lives in your home directory:

The project-level folder holds team configuration. You commit it to git. Everyone on the team gets the same rules, the same custom commands, the same permission policies.
The global ~/.claude/ folder holds your personal preferences and machine-local state like session history and auto-memory.
# CLAUDE.md: Claude's instruction manual
This is the most important file in the entire system. When you start a Claude Code session, the first thing it reads is CLAUDE.md. It loads it straight into the system prompt and keeps it in mind for the entire conversation.
Simply put: whatever you write in CLAUDE.md, Claude will follow.
If you tell Claude to always write tests before implementation, it will. If you say "never use console.log for error handling, always use the custom logger module," it will respect that every time.
A CLAUDE.md at your project root is the most common setup. But you can also have one in ~/.claude/CLAUDE.md for global preferences that apply across all projects, and even one inside subdirectories for folder-specific rules. Claude reads all of them and combines them.
What actually belongs in CLAUDE.md
Most people either write too much or too little. Here's what works.
## Write:
Generated by Thread Navigator
Press ⌘ + S to quick-export
