SkillNavora
Claude Complete Guide › Lesson 8 of 8 · about 22 minutes
Lesson 8

Claude Code for builders: CLAUDE.md memory, rules, skills, plugins and hooks

How Claude Code remembers your project (CLAUDE.md, AGENTS.md, rules and auto memory), where files go, how to write good instructions, and how skills, plugins and hooks extend it.

Checked against official sources in November 2026. Lessons build on each other.
In plain words. Every Claude Code session starts with a fresh mind. CLAUDE.md is the project handbook you leave on its desk each morning; auto memory is the notebook where Claude writes what it learned from your corrections.

Key ideas

CLAUDE.mdInstructions you write for a project or for yourself; loaded at the start of every session.
AGENTS.mdA shared instruction file many coding agents read. Claude Code reads it when there is no CLAUDE.md, or alongside it if configured.
.claude/rules/Extra rule files, optionally scoped to file patterns with a paths field.
Auto memoryNotes Claude writes itself from your corrections and preferences, per repository.
Skills and pluginsReusable procedures (/name) and installable packages, shared with your claude.ai account.
HooksCommands that run on events (for example before a tool runs) and can block actions; enforced, unlike CLAUDE.md.

How it works

1. Where instructions live

ScopeLocationShared with
Managed policymacOS /Library/Application Support/ClaudeCode/CLAUDE.md, Linux/WSL /etc/claude-code/CLAUDE.md, Windows C:\Program Files\ClaudeCode\CLAUDE.mdEveryone on the machine (set by IT)
User~/.claude/CLAUDE.mdOnly you, all projects
Project./CLAUDE.md or ./.claude/CLAUDE.mdThe team, through Git
Local./CLAUDE.local.md (add to .gitignore)Only you, this project

Run /init in a repository to have Claude draft a CLAUDE.md from the code, and /memory to open and edit memory files.

2. Write a CLAUDE.md that works

Example project CLAUDE.md
# SkillNavora website

## Build and test
- Regenerate pages with `python3 tools/gen_site.py`; never hand-edit generated HTML.
- Before publishing: no broken internal links, no file over 25 MB, headless check of changed pages.

## Conventions
- Plain English, Indian number format, no model names in commit messages.
- Secrets live in Cloudflare settings, never in the repository.

## Where things are
- Lessons: tools/aiguides/*.py   Pages: generated into the repo root
@docs/architecture.md
  • Target under 200 lines per file. Use headings and bullets; avoid contradictions.
  • Write instructions you can verify ("run X before committing"), not wishes ("write good code").
  • Import other files with @path/to/file; they load with the CLAUDE.md that references them.
  • CLAUDE.md is guidance, not enforcement. To block an action, use a PreToolUse hook or permission rules.

3. Rules for parts of the codebase

Put rules that only matter for some files in .claude/rules/, with a paths list in the frontmatter:

.claude/rules/api.md
---
paths:
  - "src/api/**/*.ts"
---
# API rules
- Every endpoint validates input and returns typed errors.
- Add a test in tests/api for each new route.

4. AGENTS.md and other tools

If your repository already has an AGENTS.md (used by several coding agents), Claude Code reads it when there is no CLAUDE.md in your working folder or above. To keep one source for every tool, put @AGENTS.md inside CLAUDE.md so both are used.

5. Auto memory

CLAUDE.mdAuto memory
Who writes itYouClaude
ContainsInstructions and rulesLearnings and patterns from your corrections
ScopeProject, user or organisationPer repository, shared across worktrees
LoadedEvery sessionEvery session (first 200 lines or 25 KB)

Review auto memory now and then with /memory, and delete notes that are wrong or outdated.

6. Skills, plugins and hooks in Claude Code

  • Skills: ~/.claude/skills/<name>/SKILL.md for you, .claude/skills/<name>/SKILL.md for the project. Run with /<name>; manage with /skills.
  • Plugins: install from marketplaces with the /plugin command, or use plugins synced from your claude.ai account (run /reload-plugins after adding one on the web).
  • Connectors you added on claude.ai are available in Claude Code when you sign in with the same account.
  • Hooks: shell commands that run on events such as before a tool call; use them to block risky commands or run formatters automatically.
  • Subagents: specialists defined as files in .claude/agents/ that Claude delegates to.

The full Claude Code walkthrough (install, plan mode, permissions, MCP, hooks, subagents, automation) is in the SkillNavora lesson Claude Code complete tutorial.

Common mistakes and fixes

MistakeFix
A 600-line CLAUDE.md that nobody readsKeep it under 200 lines; move details into imported files or path-scoped rules.
Relying on CLAUDE.md to stop dangerous commandsUse permission rules or a PreToolUse hook to enforce.
Committing CLAUDE.local.md with personal URLsAdd CLAUDE.local.md to .gitignore.
Different instructions in CLAUDE.md and AGENTS.mdImport AGENTS.md from CLAUDE.md so there is one source.

Practice

  1. Run /init in a small repository and cut the draft CLAUDE.md to the 20 lines that matter.
  2. Add one path-scoped rule in .claude/rules/ and check that Claude follows it when editing those files.
  3. Copy your Lesson 5 skill into .claude/skills/ and run it with /its-name.

Quick check

Which file holds your personal instructions for all projects?

~/.claude/CLAUDE.md

How do you include another file in CLAUDE.md?

With an @path/to/file import.

Is CLAUDE.md enforced?

No, it is context. Use permission rules or hooks to enforce behaviour.

How much of auto memory loads each session?

The first 200 lines or 25 KB.

Go further (official sources)

Refer & earn