# CLAUDE.md vs Skills vs Subagents vs Hooks

> Claude Code's four primitives compared: CLAUDE.md is always-loaded memory, skills are on-demand SKILL.md playbooks, subagents run in their own context window, hooks are deterministic scripts on events. Decision table included.

Canonical: https://www.agentickit.co/compare/claude-code-skills-vs-subagents-vs-hooks
Last updated: 2026-11-18

CLAUDE.md loads on every turn as project memory, skills (SKILL.md) load on demand when a task matches, subagents run a job in their own isolated context window with their own tools, and hooks run a deterministic script on a lifecycle event whether or not the model agrees. Most Claude Code projects use all four at once. Last updated 2026-10-29 by Rakshit Yadav.



## The four primitives, one paragraph each
**CLAUDE.md** is a plain markdown file Claude Code reads into context at the start of every session, in the project root (and optionally nested per directory). It has no frontmatter, no scoping, no on/off switch — everything in it is loaded on every single turn, so it should hold only what's always true: tenant isolation rules, package manager, how to run tests.
**Skills** live at `.claude/skills/&lt;name&gt;/SKILL.md`. Each one carries a short description Claude reads first; the full body only loads into context when the current task matches that description, or when a command or agent explicitly points at it. A skill can be a screen or several pages long because it doesn't cost anything until it's actually opened.
**Subagents** (`.claude/agents/*.md`) are the heaviest primitive: each one runs in its own context window, can be restricted to its own tool list, and returns only a final report to the main thread. That isolation is the point — a code-review pass or a long research task doesn't pollute the main conversation with its intermediate steps.
**Hooks** are scripts registered in `settings.json` against lifecycle events (before a tool runs, after a file edit, on session start, and others). They execute unconditionally — no model judgment involved — which makes them the only one of the four that can reliably block an action rather than just request one.

## Decision table: when each one wins
<table><thead><tr><th></th><th>CLAUDE.md</th><th>Skill</th><th>Subagent</th><th>Hook</th></tr></thead><tbody><tr><td>**Loads**</td><td>Always, every turn</td><td>When the task matches the description</td><td>When invoked by name or by the main agent's own judgment</td><td>On a registered event, every time, unconditionally</td></tr><tr><td>**Context cost**</td><td>Paid on every turn regardless of relevance</td><td>Near zero until opened</td><td>Zero in the main thread — it runs in its own window</td><td>Zero model context; it's a script, not a prompt</td></tr><tr><td>**Best for**</td><td>Always-true facts: stack, conventions, hard bans</td><td>A playbook that's too long to keep loaded all the time</td><td>Work that benefits from a clean, separate context: review, research, a long multi-step build</td><td>Anything that must happen without relying on the model remembering</td></tr><tr><td>**Can it be skipped?**</td><td>No, but it's easy to let it bloat and get skimmed</td><td>Yes — if the description is vague, Claude won't reach for it</td><td>Yes — the main agent decides whether to delegate</td><td>No. That's the whole value of a hook</td></tr><tr><td>**Written in**</td><td>Markdown, no frontmatter</td><td>Markdown with YAML frontmatter (name, description)</td><td>Markdown with frontmatter for name, description, tools, model</td><td>Any executable, wired via JSON config</td></tr></tbody></table>If you're deciding between a rule-like constraint and a longer playbook, the logic is the same one the Cursor side of this question uses — see [Cursor Rules vs Skills: Which One Do You Need](https://www.agentickit.co/compare/cursor-rules-vs-skills-decision).

## The common mistake: cramming everything into CLAUDE.md
CLAUDE.md is the first thing most people reach for because it's the only primitive that needs no special folder structure — just a file at the repo root. That's exactly why it accumulates everything: the Stripe webhook walkthrough, the RAG chunking strategy, the full API conventions doc, a paragraph on how deploys work. None of that is wrong information, but all of it loads on every single turn, including the turns where you're fixing a typo in a landing page and don't need any of it.
The fix isn't deleting the content. It's recognizing that CLAUDE.md should answer "what does Claude need to know on literally every turn," and moving everything else — the how-to material, the situational playbooks, the things that only matter when a specific kind of task comes up — into skills that load by description instead. A CLAUDE.md that's grown past a page is usually a sign that several skills are waiting to be extracted from it.

## Composability: how AgenticKit's 34 agents use all four together
AgenticKit's [34 subagents](https://www.agentickit.co/agents) — [tech-lead](https://www.agentickit.co/agents/tech-lead), [code-reviewer](https://www.agentickit.co/agents/code-reviewer), [security-auditor](https://www.agentickit.co/agents/security-auditor) and the rest — are the subagent layer: each one is scoped to a role and a tool list, and runs in its own context so a security audit doesn't drag thirty tool calls into your main conversation. The [commands](https://www.agentickit.co/commands) are the trigger: typing `/audit` or `/ship` is what decides a subagent runs at all, on your schedule, not the model's. The [skills](https://www.agentickit.co/skills) are what those agents and commands reach for mid-task — a Stripe webhook playbook, a Next.js App Router convention set — loaded only when the work in front of them actually matches. CLAUDE.md sits underneath all of it as the few lines every agent and command inherits automatically: which package manager this repo uses, where tests live, what must never be committed. None of the three heavier primitives replace that base file; they just keep everything that isn't always-true out of it.



## FAQ

### Does Claude Code have the same rules/skills/commands/hooks split as Cursor?
The shapes are similar but the names and mechanics differ. Claude Code's four are CLAUDE.md (always-loaded memory), skills (SKILL.md, on-demand playbooks), subagents (isolated-context delegates), and hooks (deterministic scripts on events). Cursor's are rules, skills, commands and hooks — see the Cursor-side comparison for that split.

### Should I put my project conventions in CLAUDE.md or a skill?
If it's true on every single turn and short — package manager, test command, a hard ban — CLAUDE.md. If it's a longer how-to that only matters for specific tasks, like a billing integration walkthrough, make it a skill so it only loads when relevant.

### When should I use a subagent instead of a skill?
Use a subagent when the task benefits from a separate context window — a long review, a multi-step build, anything whose intermediate steps you don't want cluttering the main conversation. Use a skill when you just need to hand the main agent a playbook to follow itself.

### Can a hook call a subagent or a skill?
A hook runs a script, not a prompt, so it can't invoke a subagent or load a skill directly. The usual pattern is the other way around: a hook enforces or logs something mechanically, and an agent or command reads the result later.

### What's the single biggest mistake teams make with these four primitives?
Writing everything into CLAUDE.md because it's the only one with no setup required, then wondering why every turn feels slower. Long or situational content belongs in a skill; CLAUDE.md should stay short.

## Related
- [The 34 AgenticKit agents](https://www.agentickit.co/agents)
- [Skills pillar](https://www.agentickit.co/skills)
- [Commands pillar](https://www.agentickit.co/commands)
- [Claude Code Agents vs Commands](https://www.agentickit.co/compare/claude-code-agents-vs-commands)
- [Cursor Rules vs Skills vs Commands (the Cursor-side version of this question)](https://www.agentickit.co/compare/cursor-rules-vs-skills)
- [Cursor Rules vs Skills: Which One Do You Need](https://www.agentickit.co/compare/cursor-rules-vs-skills-decision)
- [Cursor Rules vs AGENTS.md vs CLAUDE.md](https://www.agentickit.co/compare/cursor-rules-vs-agents-md-vs-claude-md)
- [Cursor Rules vs Claude Code CLAUDE.md (format, path scoping, and migration)](https://www.agentickit.co/compare/cursor-rules-vs-claude-md)
- [Claude Code Plugins vs Skills vs MCP: What to Use When](https://www.agentickit.co/compare/claude-code-plugins-vs-skills-vs-mcp)
- [Cursor Skills vs Claude Code Skills](https://www.agentickit.co/compare/cursor-skills-vs-claude-skills)
- [Claude Code Skills vs Cursor Rules vs Codex Skills (three-way, adds Codex)](https://www.agentickit.co/compare/claude-code-skills-vs-cursor-rules-vs-codex-skills)
- [Claude Code Skills vs Claude Agent Skills (API): the naming confusion, disambiguated](https://www.agentickit.co/compare/claude-code-skills-vs-agent-sdk-skills)
- [Claude Code Subagent Limits: Concurrency and the Model Setting](https://www.agentickit.co/compare/claude-code-subagent-concurrency-model-setting)
- [Claude Code Skills vs Plugins: Token Cost Breakdown](https://www.agentickit.co/compare/claude-code-skills-vs-plugins-token-cost)
- [code-reviewer agent](https://www.agentickit.co/agents/code-reviewer)
- [tech-lead agent](https://www.agentickit.co/agents/tech-lead)
