11 May 2026
إتقان ملف CLAUDE.md: اضبط المهارات والـ Hooks وذاكرة مشروعكCLAUDE.md Mastery: Configuring Skills, Hooks and Project Memory for Your Codebase
Go from an empty CLAUDE.md to a full setup: the right file levels, a structure Claude follows, declared skills, hooks that enforce rules, and project memory that grows with every decision.
Who this guide is for
Developers and teams who run Claude Code on a real codebase every day
Key terms
- CLAUDE.md
- A Markdown file Claude Code loads at the start of every session. It holds your project context, commands, rules and limits.
- Skill
- A folder with a SKILL.md file that teaches Claude a repeatable task. Claude uses it when the situation matches its description.
- Hook
- A command Claude Code runs automatically at a fixed moment, like before a tool runs. It is set in settings.json and runs whatever Claude decides.
- settings.json
- The Claude Code config file. The one in .claude/ inside your repo is shared with the team through git.
- Exit code 2
- When a PreToolUse hook exits with 2, Claude Code blocks that tool call and shows Claude the reason.
The steps
Step 1
Put CLAUDE.md files at the right levels
Claude Code reads CLAUDE.md from several places. The global file at ~/.claude/CLAUDE.md applies to all your projects, so it holds your personal style and general preferences. The file at the repo root holds this project's conventions, architecture and context.
You can also add a CLAUDE.md inside a folder. Claude reads it when it works in that folder, so api/ can have its own rules and frontend/ its own conventions.
The levels add up. Global, then project, then folder. Use that on purpose so rules never repeat or contradict each other.
Run the commands below. In a session, the /memory command shows the files Claude loaded. The /init command can also draft a first project file for you.
PromptTerminal: create the files# Global file: applies to every project mkdir -p ~/.claude && touch ~/.claude/CLAUDE.md # Project file at the repo root touch ./CLAUDE.md # Folder level files for parts with their own rules mkdir -p ./src/api ./src/frontend touch ./src/api/CLAUDE.md ./src/frontend/CLAUDE.md # List every CLAUDE.md in the project find . -name 'CLAUDE.md' -not -path '*/node_modules/*' -not -path '*/.git/*' # Inside a Claude Code session, see and edit the memory files it loaded /memory
7 more steps wait for you after access
With the ready prompts and the takeaway
Bought this before? Restore your access
Your access is tied to your email. Enter it here and the content opens right away, any time, on any device
Most value
Start building with me now
We sit together, break down your problem, and I build the AI solution with you step by step
- A private session with you
- Real building during the session
- Results you take with you when we finish
100% free
A free consultation about your problem