Claude Code Skills vs Hooks vs Subagents: Full Guide

Claude Code Skills vs Hooks vs Subagents explained
Reviewed by: TechZila AI Research Desk | Verified August 2026 | 9 min read | Verified against Anthropic's official Claude Code documentation
Disclosure: TechZila is reader-supported. Some links may earn us a commission at no additional cost to you. Our editorial decisions remain independent.

TL;DR — Quick Summary

  • Skills teach. They give Claude reusable knowledge, checklists, or invocable workflows.
  • Hooks trigger. They run automatically at a configured lifecycle event, deterministically.
  • Subagents isolate. They run a specialized task in a separate context window and return a summary.
  • These three extension surfaces are complementary, not competing — most serious Claude Code workflows use all three together with CLAUDE.md.

Claude Code now has three distinct ways to extend how it works, and developers frequently reach for the wrong one — writing a Skill when they needed a Hook, or a CLAUDE.md instruction when they needed enforcement they can't get from prose at all.

Skills teach Claude reusable knowledge, Hooks trigger automatic actions at lifecycle events, and Subagents isolate specialized work in a separate context window. This isn't an official Anthropic slogan — it's our editorial shorthand for three genuinely different jobs the documentation describes separately.

What Are Skills, Hooks, and Subagents?

Anthropic's Claude Code extension documentation describes three separate mechanisms, each solving a different problem in an agentic coding workflow.

FeatureWhat It Officially DoesBest Use
SkillsProvides reusable knowledge, instructions, and workflows/review, /deploy, API conventions, debugging procedures
HooksRuns a command, HTTP request, MCP tool, prompt, or agent at lifecycle eventsFormatting, linting, logging, blocking risky actions
SubagentsPerforms a specialized task in a separate context window and returns a summaryRepository research, security review, parallel investigation
CLAUDE.mdProvides persistent project context and instructionsCoding conventions, build commands, project rules

Skills Explained

A Claude Code Skill is a reusable piece of knowledge or a repeatable workflow, defined in a SKILL.md file, that Claude can use automatically or that a developer can invoke directly.

Verified details about Skills, based on Anthropic's official documentation:

  • Created from a SKILL.md file.
  • Claude can use a Skill automatically when it's relevant to the task.
  • A user can also invoke one directly with /skill-name.
  • Skill content isn't loaded into full context until it's actually used.
  • Custom commands have been merged into Skills — existing .claude/commands/ files still work.
  • Skills can be reusable reference material or multi-step workflows.
  • Skills can also run inside a Subagent's context.
  • disable-model-invocation: true is useful for workflows that should only run when a human explicitly triggers them, given their side effects.
Use a Skill when: Claude needs reusable knowledge, a repeatable procedure, or an invocable workflow — such as a code-review checklist or a deployment sequence.

Hooks Explained

A Claude Code Hook runs automatically at a configured lifecycle event, giving you deterministic control that a plain-language instruction can't guarantee.

Verified details about Hooks:

  • Run at configured lifecycle events, including PreToolUse, PostToolUse, SessionStart, Stop, SubagentStart, and SubagentStop.
  • Support command, HTTP, MCP-tool, prompt, and agent handler types.
  • Can block a tool call before it executes.
  • Can run validation or logging after a tool call.
  • Can be filtered by matcher to apply to specific tools or events.
  • Receive hook input as JSON.
  • Can be defined through settings, plugins, skills, or subagent configuration.

An example configuration — not a universal recommended setup — showing the general shape of a hook that runs a format check after a file edit:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "npm run format:check"
          }
        ]
      }
    ]
  }
}

Hook event names and configuration schema have changed across Claude Code versions. Verify the exact syntax against the current official documentation for your installed version before using this in a project.

Important Nuance: Hooks don't "always fire" in some absolute sense — a matching hook runs when its configured lifecycle event occurs and its matcher applies. Both the event and the matcher matter for whether a given hook actually executes.
Use a Hook when: An action should happen automatically at a configured event, you need to repeat formatting/linting/logging/validation, you need to control a risky operation before execution, or the outcome shouldn't depend on the model's judgment.

Subagents Explained

A Claude Code Subagent runs a specialized task in its own context window and returns a summary to the main conversation, instead of filling the main session with intermediate work.

Verified details about Subagents:

  • Run in a separate context window from the main conversation.
  • Keep the main conversation from getting cluttered with large search results, logs, or file contents.
  • Can have a custom system prompt.
  • Can be restricted to specific allowed or denied tools.
  • Can have independent permissions.
  • Can use a different model than the main session.
  • Are used as specialized workers for a focused task.
  • Return results as a summary to the main agent.
  • Built-in examples include Explore, Plan, and general-purpose agents.
Use a Subagent when: A task needs a specialized worker, a separate context window, or an investigation whose intermediate output doesn't need to stay in the main conversation.

Comparison Table

QuestionSkillsHooksSubagents
Runs automatically?Can be auto-invoked by Claude, or called with /skill-nameYes, at matched lifecycle eventsNo — invoked by the main agent for a specific task
Deterministic?No — depends on Claude's judgment or explicit invocationYes — runs the same way every time its event/matcher firesDepends on the task, but context isolation itself is deterministic
Isolates context?Only when run inside a SubagentNo — hooks don't hold conversational contextYes — that's the core purpose
Best for enforcement?NoYesNo, but useful for isolated verification tasks

Where CLAUDE.md Fits

CLAUDE.md provides persistent context and instructions that Claude reads at the start of a session — coding conventions, build commands, architecture notes. It's useful precisely because it's always loaded, but that's also its limitation: it's context the model tries to follow, not something enforced.

Use CLAUDE.md when: An instruction is useful in every relevant session, or you're explaining project conventions, build commands, or architecture. Don't rely on CLAUDE.md alone for anything that requires guaranteed enforcement — that's what Hooks are for.

Can These Work Together?

Yes — Anthropic's documentation describes Skills, Hooks, and Subagents as complementary extension surfaces, not alternatives you choose between once. A single workflow can use all three: a Skill defines the procedure, a Subagent runs the isolated research the procedure needs, and a Hook automatically runs the linter once the Subagent's changes land.

Practical Example: A Code-Review Workflow

Here's how the three pieces might combine for a real code-review workflow:

  1. Skill: A /review Skill defines the checklist — check test coverage, verify error handling, confirm no unrelated files changed.
  2. Subagent: An Explore-style subagent investigates the affected files and dependencies in an isolated context, returning only a summary of what changed and why.
  3. Hook: A PostToolUse hook automatically runs the linter and formatter after any edit the review process makes.
  4. CLAUDE.md: Sits underneath all of it, providing the project's coding conventions so every step stays consistent with how the codebase is actually written.

Common Mistakes

  • Treating CLAUDE.md as enforcement. It's context, not a guarantee — use a Hook for anything that must always happen.
  • Assuming Skills are always better than CLAUDE.md. They solve different problems; this isn't a strict upgrade path.
  • Assuming Hooks guarantee complete security. A hook only runs for the event and matcher it's configured for — misconfigured matchers create gaps.
  • Assuming Subagents always reduce cost. Context isolation has benefits, but running additional specialized agents isn't universally cheaper.
  • Assuming any of this guarantees correct code. None of these features verify correctness on their own — that still requires tests and checks.

Decision Tree

Quick Decision Guide

Need Claude to remember a repeatable procedure or domain knowledge? → Use a Skill.

Need something to happen automatically and reliably at a specific point, no matter what Claude decides? → Use a Hook.

Need to investigate something without cluttering the main conversation, or need a specialized worker with different tools/permissions? → Use a Subagent.

Need project-wide context loaded into every session? → Use CLAUDE.md, but back critical rules with a Hook.

TechZila Analysis™

The Core Truth

These three features aren't competing options — they're answers to three different questions: what should Claude know, what should always happen, and what should stay out of the main conversation. Picking the wrong one doesn't just underperform, it often produces the specific failure mode you were trying to avoid — like expecting CLAUDE.md to enforce a security rule it was never built to enforce.

The Hidden Context

The most consequential distinction in this entire feature set is the one buried in a documentation nuance: hooks don't "always fire" in some absolute sense — a matching hook runs when its event and matcher both apply. Teams that assume broader coverage than their matcher actually configures are the ones who get surprised later.

TechZila Opinion

As Claude Code's extension surface keeps expanding, we expect "which primitive should I use" to become as common a developer question as "which data structure should I use" was a decade ago. This is our forward-looking read of the trend, not a confirmed Anthropic roadmap.

Frequently Asked Questions

What is the main difference between Skills, Hooks, and Subagents in Claude Code?
Skills give Claude reusable knowledge, instructions, or invocable workflows. Hooks run automatically at configured lifecycle events like a command, HTTP request, or MCP tool call. Subagents run a specialized task in a separate context window and return a summary, keeping the main conversation uncluttered.

Do Hooks always run every time?
A matching hook runs when its configured lifecycle event occurs and its matcher applies — it's not that every hook fires on every action, but that a correctly configured hook for a matched event and tool runs deterministically, unlike a CLAUDE.md instruction.

Can Skills, Hooks, and Subagents be used together?
Yes. Anthropic's documentation describes these as complementary extension surfaces — for example, a Skill can define a code-review workflow, a Subagent can run the isolated research for it, and a Hook can automatically run the linter afterward.

Is CLAUDE.md a replacement for Skills, Hooks, or Subagents?
No. CLAUDE.md provides persistent project context and instructions that Claude reads at the start of a session, but it is not enforced configuration and doesn't isolate context or run automatically at lifecycle events the way Hooks and Subagents do.

Keep This Bookmarked: This guide is the supporting piece to our Claude Code Loop Engineering pillar article — that guide explains the verification loop itself, this one explains the individual tools you use to build it.

Related Reading

About TechZila AI Research Desk

TechZila AI Research Desk researches AI models, developer tools, cybersecurity, and emerging technology. Every guide is verified against official documentation, release notes, and primary sources before publication.

Last Verified Against:

  • ✓ Anthropic Claude Code features overview documentation
  • ✓ Anthropic Claude Code Skills documentation
  • ✓ Anthropic Claude Code Hooks documentation
  • ✓ Anthropic Claude Code Subagents documentation
  • ✓ Anthropic Claude Code best-practices documentation

Sources: Anthropic Claude Code official documentation (features overview, skills, hooks, sub-agents, best-practices). Verified August 2026.


SEO Package (Not part of published post — for your Blogger post settings)

Meta Title:
Claude Code Skills vs Hooks vs Subagents: Full Guide

Meta Description:
Skills, Hooks, and Subagents in Claude Code explained: what each does, verified official details, code examples, and a decision framework for when to use which.

Permalink:
claude-code-skills-vs-hooks-vs-subagents

Primary Keyword: Claude Code Skills vs Hooks vs Subagents

Secondary Keywords: Claude Code skills, Claude Code hooks, Claude Code subagents, Claude Code SKILL.md, Claude Code lifecycle hooks, Claude Code custom workflows, CLAUDE.md vs skills, Claude Code automation

Tags/Labels:
Claude Code, Anthropic, AI Coding Assistant, Developer Tools, TechZila

Topical Authority Notes:

  • Role in cluster: Supporting article to the Claude Code Loop Engineering pillar page.
  • Suggested future articles: "Claude Code Skills Explained (With SKILL.md Examples)"; "Claude Code Hooks Explained: Every Lifecycle Event Covered"; "Claude Code Subagents Explained: Explore, Plan, and Custom Workers"

Evidence Status Note (internal): All core feature claims (Skills reusable workflows, Hooks lifecycle events, Subagents isolated context) are officially verified against Anthropic's documentation. The "Skills teach, Hooks trigger, Subagents isolate" framing is explicitly TechZila's editorial shorthand, not an Anthropic slogan — stated as such in the article. Overclaims deliberately avoided: Skills are not claimed to be universally better than CLAUDE.md, Hooks are not claimed to guarantee complete security, Subagents are not claimed to always reduce cost, and no feature is claimed to guarantee correct code.

Freshness Note: Last Verified: August 2026. Claude Code's extension surface is evolving quickly — re-verify hook event names, Skill invocation syntax, and subagent configuration against current docs before major republishing.

Post a Comment

0 Comments