1
CLAUDE.md
The Memory Layer
architecture rules
naming conventions
test expectations
repo map
~/.claude/CLAUDE.md — Global
.claude/CLAUDE.md — Project
.claude/CLAUDE.md — Project
Always loaded. Always active. This is the agent's constitution.
2
Skills
The Knowledge Layer
SKILL.md
→
description matching
→
auto-invoked
→
task-specific context
On-demand, not always-on. Modular context chunks.
reference docs
scripts
templates
Key: context fork runs skill in isolated subagent.
3
Hooks
The Guardrail Layer
PreToolUse
PostToolUse
SessionStart
Stop
SubagentStop
auto-lint on Write
→
block rm -rf
→
Slack notification on Stop
Event fires → Matcher checks → Command runs
Deterministic. Not AI. Think Git hooks for your agent.
4
Subagents
The Delegation Layer
code-reviewer
own context · custom model/tools/permissions
test-runner
own context · custom model/tools/permissions
explorer
own context · custom model/tools/permissions
delegate only → subagent runs → results only back
Keeps main context clean. No infinite recursion — subagents can't spawn subagents.
5
Plugins
The Distribution Layer
skills/
agents/
hooks/
commands/
→
Marketplace / Team install
Think npm packages for agent capabilities.