Claude Code Agents, Skills, Hooks, and MCP Explained - Step-by-step guide for Level Up

Claude Code Agents, Skills, Hooks, and MCP Explained

By Mark FershteynPublished Last updated 15 min readadvanced

Understand Claude Code agents, subagents, skills, hooks, and MCP. Learn when to use each feature to get better results with less effort.


Claude Code agents, skills, hooks, and MCP-what's the difference? This guide explains each concept in plain English and shows you exactly when to use each one.

Claude Code has several powerful concepts that confuse a lot of people: agents, subagents, skills, hooks, and MCP.

They sound similar. They overlap in some ways. And most guides skip explaining when to actually use each one.

This Claude Code tutorial breaks down the differences-and shows you exactly when to use each approach.

Context

Do you need all of this to use Claude Code? No. These are power-user features. Most people can be highly productive with just basic Claude Code for months before touching any of this. Think of this guide as a reference for when you're ready to level up-not required reading before you start.

The Quick Version

Here's the shortest possible explanation:

ConceptWhat It IsWhen to Use It
AgentClaude Code itself-the main AI assistantYour default interaction
SubagentA specialized worker that runs separatelyTasks with lots of output, parallel work
SkillReusable instructions Claude follows automaticallyRepeated processes, team standards
HookAutomated trigger that runs at specific momentsAuto-backup, validation, notifications
MCPConnection to external tools and servicesDatabase access, APIs, custom integrations
CLAUDE.mdProject-specific instructions filePer-project context and rules

Now let's dig into each one.


Part 1: What Are Agents?

An agent in AI refers to a system that can take autonomous action-not just generate text. Claude Code is an agent because it reads files, runs commands, and executes multi-step tasks on your computer. You don't need to set anything up-every time you use Claude Code, you're using an agent.

Here's a clarification most people miss:

"Agent" isn't a separate feature. Claude Code is an agent.

When people talk about "agents" in Claude Code, they usually mean the main Claude Code assistant you interact with-the one that reads your files, writes code, and runs commands.

The word "agent" just means an AI that can take action, not just talk. Regular ChatGPT or Claude chat gives you text to copy and paste. An agent actually does things.

Claude Code is an agent because it:

  • Reads and edits files directly
  • Runs terminal commands
  • Creates and modifies projects
  • Works autonomously on multi-step tasks

Bottom line: Every time you use Claude Code, you're using an agent. There's nothing special to set up.


Part 2: What Are Subagents?

A subagent is a specialized worker that Claude spawns to handle specific tasks in isolation, with its own separate context window. Subagents are useful for tasks that produce verbose output (like test suites), running parallel work, or restricting tool access. Claude Code includes built-in subagents like Explore (fast codebase search) and Plan (research gathering).

Subagents are where things get interesting.

A subagent is a specialized version of Claude that handles a specific task in isolation.

Think of it like this: instead of the main Claude doing everything sequentially, it delegates work to smaller, focused workers that run separately.

How Subagents Work

Each subagent:

  • Runs in its own context window - It has a separate conversation with its own memory
  • Has its own system prompt - It's configured for a specific type of task
  • Has specific tool access - Some subagents can only read files, others can edit
  • Returns a summary - Only the result comes back, not all the verbose output

What Subagents Look Like

When Claude spawns a subagent, you'll see it in your terminal:

claude - ~/my-project
$claude
You: Find all API endpoints in this codebase
Running subagent: Exploring codebase for API endpoints...

When the subagent completes, you get a summary-not the full verbose output:

claude - ~/my-project
Subagent complete
Found 23 API endpoints across 8 files:
• /api/users - GET, POST, PUT, DELETE
• /api/products - GET, POST
• /api/orders - GET, POST, PUT
• ... and 17 more

Instead of 500 lines of grep output cluttering your conversation, you get a clean summary.

Why Use Subagents?

The main reasons:

1. Keep verbose output out of your conversation

When Claude runs a test suite, it might generate 500 lines of output. Without subagents, all that clutter fills your main conversation and eats up context.

With subagents, the test runs separately. You just get: "All 47 tests passed."

2. Run tasks in parallel

Need to analyze three competitors and process customer feedback? Subagents can work simultaneously instead of one-at-a-time.

3. Enforce tool restrictions

You can create a subagent that can only read files-never edit them. Perfect for code reviews or audits where you don't want accidental changes.

4. Use cheaper/faster models for specific tasks

Some built-in subagents use Haiku (faster and cheaper) instead of Opus or Sonnet. Great for simple searches where you don't need the heavy model.

Built-In Subagents

Claude Code comes with several subagents ready to use:

SubagentWhat It DoesModelCost
ExploreFast, read-only codebase searchHaikuLow
PlanResearch and context-gathering for plan modeYour selected modelStandard
General-purposeComplex multi-step tasks needing exploration + actionYour selected modelStandard
BashRuns terminal commands in separate contextYour selected modelStandard

How to Use Subagents

You can explicitly ask Claude to delegate:

Create a subagent to analyze our top 3 competitors while you
process customer feedback. Then combine the insights.

Or Claude may automatically use subagents when it makes sense-like using the Explore subagent to search your codebase.

Tip

When to use subagents: Tasks that produce lots of output (test suites, log analysis), parallel independent work, or when you want to restrict what Claude can do.

Cost and Usage

Do subagents count against your usage limits?

Yes. Each subagent uses tokens from your plan. However:

  • Explore subagent uses Haiku, which is significantly cheaper than Opus/Sonnet
  • Parallel subagents don't cost more than sequential work-same tokens, just faster
  • Isolated context can actually save tokens by keeping verbose output out of your main conversation

The cost trade-off is usually favorable: subagents prevent context bloat, which would otherwise force expensive re-processing or context summarization.


Part 3: What Are Skills?

Skills are reusable instruction sets stored as markdown files that Claude follows automatically when relevant. Unlike subagents that run in isolation, skills are injected directly into your main conversation. Use skills for repeated processes: brand voice guidelines, code review checklists, report formatting, or any workflow you do more than twice.

Skills are completely different from subagents.

A skill is a set of reusable instructions that Claude follows automatically.

Think of skills as teaching Claude how you work. Instead of re-explaining your preferences every time, you set them once.

How Skills Work

Skills are stored as markdown files (.md) with some metadata at the top. When you give Claude a task that matches a skill's description, it automatically applies those instructions.

Key characteristics:

  • Injected into your main conversation - Unlike subagents, skills don't run separately
  • Triggered automatically - Claude detects when a skill is relevant
  • Additive knowledge - Skills add context, they don't take over the conversation
  • Persistent - Skills stay with you across sessions

What Skills Look Like

When you create or enable a skill, it appears in your Claude settings:

Claude Settings - Skills
Brand Voice Guidelines
Writing tone and style rules
Enabled
Code Review Checklist
PR review standards
Enabled
Report Formatting
Weekly report template
Enabled
Skills appear in Settings → Capabilities → Skills. Enable or disable them as needed.

When Claude uses a skill, you'll see it indicated in the conversation:

Claude Code
Write a product announcement for our new dashboard feature
Using: Brand Voice Guidelines
Here's a draft announcement following your brand guidelines...
Claude shows which skills it's applying to your current task

Skill Levels: Where Do They Live?

Skills can exist at different levels:

LevelScopeUse Case
PersonalOnly you, across all projectsYour individual preferences
ProjectAnyone working in this folderProject-specific standards
OrganizationEveryone in your companyCompany-wide guidelines

For beginners: Start with personal skills. Create them at claude.ai and they'll apply everywhere you use Claude.

Why Use Skills?

Skills compound over time. The more Claude knows about how you work, the less you explain.

Use skills for:

  • Brand voice - How your company sounds in writing
  • Code standards - Your team's conventions and patterns
  • Report formatting - Your standard structure for analysis
  • Review checklists - What to verify before any deliverable
  • Domain knowledge - Industry-specific context Claude should know

How to Create a Skill

Option 1: Ask Claude to help

  1. Open a new chat at claude.ai
  2. Type: "Help me build a skill"
  3. Describe what you want Claude to remember
  4. Claude generates the skill file
  5. Click Enable Skill (or upload via Settings → Capabilities → Skills)

Option 2: Create the file manually

Skills are markdown files with YAML frontmatter:

---
name: brand-voice
description: Guidelines for writing in our company's voice
---

# Brand Voice Guidelines

When writing content for Acme Corp:

- Use active voice
- Keep sentences under 20 words
- Avoid jargon-explain technical concepts simply
- Tone is confident but not arrogant
- Always address the reader directly ("you")

## Words We Use
- "simple" not "easy"
- "powerful" not "robust"
- "help" not "enable"

## Words We Avoid
- "Leverage"
- "Synergy"
- "Best-in-class"
Context

Ready to set up skills? See our Complete Skills Setup Guide for step-by-step instructions on installing and creating skills. Browse the Skills Library for pre-built skills you can use immediately.

Pairing Skills with Claude Code

Skills work with Claude Code to execute instructions on your files:

Use my brand-voice-checker skill to analyze all the newsletters
in this folder and flag anything off-brand.

Claude applies the skill's guidelines while processing your actual files.

Tip

Build a skill for any process you repeat. Data cleaning steps, report formatting, content reviews-if you do it more than twice, it should be a skill.


Part 4: Skills vs. CLAUDE.md - What's the Difference?

Skills are personal preferences that follow you across all projects (brand voice, formatting style). CLAUDE.md is project-specific context that lives in your project folder and is visible to anyone with repo access. Use both together: CLAUDE.md for project documentation (tech stack, how to run tests), Skills for your personal standards.

This trips up a lot of people. Both seem like "instructions for Claude." Here's the distinction:

AspectSkillsCLAUDE.md
ScopeCan be personal, project, or org-wideAlways project-specific
LocationStored in Claude's systemLives in your project folder
PortabilityFollows you across projectsStays with the project
VisibilityOnly Claude sees itVisible to anyone with repo access
Best forYour personal preferencesProject context anyone needs

When to Use Each

Use Skills when:

  • It's your preference (brand voice, formatting style)
  • You want it to apply across multiple projects
  • It's personal or team-wide, not project-specific

Use CLAUDE.md when:

  • It's project context (tech stack, architecture decisions)
  • Anyone working on this project needs it
  • It should live in version control with the code
  • It includes project-specific commands or paths

They Work Together

The best setup uses both:

CLAUDE.md (in your project)
├── Project overview and goals
├── Tech stack (React, Node, PostgreSQL)
├── How to run tests: npm test
├── Database schema location
└── Deployment process

Skills (in your personal settings)
├── Your brand voice guidelines
├── Your code review checklist
└── Your preferred commit message format

Claude reads both and combines them. Project context from CLAUDE.md + your personal standards from Skills.

Key Insight

Think of it this way: CLAUDE.md is like a README for Claude-project documentation. Skills are like your personal preferences file-they follow you everywhere.


Part 5: What Are Hooks?

Hooks are automated actions that trigger at specific moments in Claude Code's workflow-before/after file edits, before/after commands, or at session start. Common uses include auto-backups before edits, running linters after changes, logging Claude's actions, or sending notifications when tasks complete. Start with pre-edit backups-it's the highest-value hook.

Hooks are automated actions that trigger at specific moments in Claude's workflow.

Think of hooks as "if this happens, do that" rules.

How Hooks Work

You define hooks that fire at key points:

Hook TypeWhen It FiresExample Use
Pre-editBefore Claude edits any fileCreate automatic backups
Post-editAfter Claude edits a fileRun linter, format code
Pre-commandBefore running a terminal commandLog what's about to run
Post-commandAfter a command completesCheck for errors, notify you
Session startWhen you begin a Claude Code sessionLoad project context

What Hooks Look Like

Here's a simple hook that backs up files before editing:

{
  "hooks": {
    "pre-edit": {
      "command": "cp $FILE $FILE.backup",
      "description": "Backup file before editing"
    }
  }
}
claude - ~/my-project
You: Fix the bug in the login handler
Hook: Creating backup of src/auth/login.ts
Backup created: src/auth/login.ts.backup
Editing src/auth/login.ts...
File updated successfully

Why Use Hooks?

Hooks provide safety nets and automation:

  • Auto-backup - Never lose work to an unintended edit
  • Validation - Run tests or linters after changes
  • Logging - Track what Claude does for audit purposes
  • Notifications - Get alerted when long tasks complete
  • Formatting - Auto-format code after every edit

Hooks vs. Skills vs. Subagents

FeaturePurposeRuns When
SkillsAdd knowledge/instructionsWhen relevant to your task
SubagentsExecute isolated tasksWhen Claude delegates work
HooksAutomate actionsAt specific trigger points

Skills tell Claude what to do. Hooks tell Claude what else should happen when it does things.

Tip

Start with one hook: Auto-backup before edits. It's the highest-value, lowest-risk hook and will save you eventually.


Part 6: What Is MCP?

MCP (Model Context Protocol) is how Claude Code connects to external tools and services like databases, APIs, and custom systems. With MCP, Claude can query PostgreSQL directly, post to Slack, search Notion, or access your company's internal tools. MCP is an advanced feature-most users don't need it unless they have databases or APIs they want Claude to access directly.

MCP (Model Context Protocol) is how Claude connects to external tools and services.

Think of MCP as plugins that give Claude new capabilities.

How MCP Works

By default, Claude Code can read files, run commands, and search your codebase. MCP servers extend this to:

  • Databases - Query PostgreSQL, MySQL, MongoDB directly
  • APIs - Connect to Slack, GitHub, Notion, etc.
  • Custom tools - Your company's internal systems
  • Web services - Search engines, documentation sites
Claude Settings - MCP Servers
PostgreSQL Database
Connected to production DB
Active
Slack Workspace
Acme Corp workspace
Active
Notion API
Team documentation
Active
MCP servers appear in settings once connected. Claude can use them like any other tool.

Why Use MCP?

Without MCP, you'd have to:

  1. Manually export data from your database
  2. Give Claude the export file
  3. Ask your question
  4. Take Claude's answer back to your database

With MCP:

  1. Ask Claude to query your database directly
  2. Get your answer

Common MCP use cases:

  • "What were our top-selling products last month?" (queries your database)
  • "Post this update to the #engineering Slack channel" (uses Slack API)
  • "Find all Notion pages about our onboarding process" (searches Notion)

MCP vs. Other Features

FeatureWhat It Extends
SkillsClaude's knowledge
SubagentsClaude's parallel execution
HooksClaude's workflow automation
MCPClaude's available tools

MCP doesn't change how Claude thinks-it gives Claude new things to interact with.

Context

MCP is advanced. Most users don't need it. It's for teams with databases, APIs, or custom systems they want Claude to access directly. If that's not you, skip it for now.


Part 7: Subagents vs. Skills - The Key Decision

This is the core question most people have. Here's a decision framework:

Use Subagents When:

  • Output is verbose - Test suites, log processing, large searches
  • Tasks are independent - Multiple analyses that don't depend on each other
  • You want isolation - Keep noisy work out of your main context
  • You need tool restrictions - Read-only audits, code reviews
  • Speed matters for simple tasks - Use Haiku-based subagents for fast searches

Use Skills When:

  • Knowledge is reusable - Brand guidelines, coding standards, review checklists
  • Context matters - The skill needs to see your full conversation
  • Team standardization - Everyone should follow the same process
  • No execution isolation needed - Work happens in your main conversation

The Key Difference

AspectSubagentsSkills
Where it runsSeparate context (isolated)Main conversation
What it returnsSummary onlyFull output visible
Best forExecution tasksAdding knowledge
OverheadStartup cost (new context)No startup cost
Tool accessCan be restrictedUses conversation's permissions

Real Examples

Scenario: Running your test suite

Use a subagent. Tests produce hundreds of lines of output. You just want to know if they passed.

Scenario: Writing in your brand voice

Use a skill. Claude needs your brand guidelines in the main conversation while it writes.

Scenario: Analyzing three competitors simultaneously

Use subagents. Three independent tasks that can run in parallel. Each returns a summary.

Scenario: Code review following your team's standards

Could use either:

  • Skill - If you want the full review in your conversation
  • Subagent - If the repo is huge and you want a condensed report

Part 8: Plugins - The Distribution Layer

One more concept worth knowing: Plugins.

Plugins aren't a new type of agent or skill. They're a packaging mechanism.

A plugin bundles together:

  • Subagents
  • Skills
  • Hooks
  • MCP servers

Plugins let teams distribute their customizations to others. You install a plugin, and you get all its subagents, skills, hooks, and MCP connections at once.

Think of plugins like browser extensions-they package up functionality so you don't have to set everything up manually.

Install Plugin - Engineering Team Plugin
This plugin includes:
Code Standards
Skill - Team coding conventions
PR Template
Skill - Pull request format
Auto-format on save
Hook - Runs Prettier after edits
Internal Docs
MCP Server - Company documentation
Installing a plugin gives you everything it contains-skills, hooks, subagents, and MCP servers
Context

You don't need plugins to get started. They're for power users who want to share configurations across teams or the community.


Part 9: Practical Workflows

Let's put this together with real examples.

Workflow 1: Weekly Report Generation

The task: Every Friday, generate a summary report from your analytics data.

The approach:

  1. Create a skill with your report format, required sections, and tone
  2. Tell Claude Code to use the skill on your latest data export
  3. Claude follows your template automatically

Why this works: Skills ensure consistency. Every report looks the same without re-explaining.

Workflow 2: Large Codebase Analysis

The task: Find all API endpoints and document them.

The approach:

  1. Claude uses the Explore subagent to search your codebase (fast, cheap)
  2. Results come back summarized
  3. Main Claude organizes findings into documentation

Why this works: Explore runs on Haiku-fast and cheap. The full search output stays isolated.

Workflow 3: Competitor Research + Internal Analysis

The task: Compare your product positioning against three competitors.

The approach:

  1. Spawn three subagents to research each competitor in parallel
  2. Spawn a fourth subagent to analyze your internal positioning docs
  3. Main Claude synthesizes all four summaries into a single report

Why this works: Parallel execution. Each subagent returns a summary. No context bloat.

Workflow 4: Code Review With Standards + Auto-Backup

The task: Review a pull request following your team's conventions.

The approach:

  1. Set up a hook to backup files before any edit
  2. Create a skill with your code review checklist
  3. Ask Claude to review the PR using that skill
  4. If Claude suggests fixes, the hook ensures you have backups

Why this works: Skills ensure consistent reviews. Hooks provide safety nets.

Workflow 5: Database-Powered Analysis

The task: Answer business questions from your production data.

The approach:

  1. Connect your database via MCP
  2. Ask Claude questions in plain English
  3. Claude writes and runs SQL queries directly
  4. You get answers without manual exports

Why this works: MCP eliminates the export/import cycle.


Quick Reference

When to Use Each

SituationUse This
Normal Claude Code tasksMain agent (default)
Tasks with verbose outputSubagent
Parallel independent workMultiple subagents
Reusable instructionsSkill
Project-specific contextCLAUDE.md
Team-wide standardsSkill (org level)
Auto-backup or validationHook
External tool accessMCP
Tool restrictions neededSubagent with limited access
Fast codebase searchesExplore subagent

The Mental Model

SkillsAdd knowledge
injects
Claude Code
delegates
SubagentsIsolated work
HooksAutomate actions
triggers
connects
MCPExternal tools
How the pieces fit together: Skills add knowledge, Subagents isolate work, Hooks automate actions, MCP connects external tools
  • Agent = Claude Code itself (your default)
  • Subagent = Specialized worker for isolated tasks
  • Skill = Reusable instructions injected into your conversation
  • CLAUDE.md = Project-specific context file
  • Hook = Automated action at trigger points
  • MCP = Connection to external tools
  • Plugin = Bundle of all the above for distribution

Common Questions

Do I need to set up subagents manually?

No. Claude Code has built-in subagents (Explore, Plan, Bash) that it uses automatically. You can also ask Claude to create custom subagents for specific tasks.

Can subagents use skills?

Yes. When you spawn a subagent, it can reference skills if you configure it that way.

How many subagents can run at once?

Multiple subagents can run in parallel. The exact limit depends on your system, but 3-4 concurrent subagents is typical.

Do skills work in Terminal and Desktop App?

Yes. Skills work across all Claude Code interfaces-Terminal, Desktop App, web, and IDE integrations.

What if I want a subagent that always follows certain rules?

Combine them: create a skill with your rules, then spawn a subagent that uses that skill.

Should I use subagents for everything?

No. Subagents have startup overhead (new context window). For quick tasks, the main agent is faster.

Do these features cost extra?

Everything runs on your existing Claude Pro subscription. Subagents and MCP queries use tokens from your plan. The Explore subagent uses cheaper Haiku tokens. There's no separate charge for skills, hooks, or MCP connections themselves.

What's the difference between CLAUDE.md and Skills again?

CLAUDE.md lives in your project folder and contains project-specific context. Skills live in Claude's settings and contain your personal/team preferences. Use CLAUDE.md for "what this project is," use Skills for "how I like to work."


What's Next?

Now that you understand the differences:

Immediate steps:

  1. Try asking Claude to use a subagent for your next verbose task (test suite, log analysis)
  2. Create one skill for something you repeat often
  3. Add a CLAUDE.md file to your main project
  4. Notice when Claude automatically uses the Explore subagent for searches

Keep learning:

Key Insight

The key insight: Subagents are for doing work in isolation. Skills are for adding knowledge to your conversation. Hooks automate actions at key moments. MCP connects external tools. You don't need all of them-start with what solves your immediate problem.


Ready to Master Claude Code?

Understanding agents, subagents, and skills is the difference between using Claude Code casually and using it like a power user.

Join AI Essentials for Business Leaders-our live bootcamp where we go hands-on with these concepts and more.

You'll leave with:

  • Custom skills built for your specific work
  • Practical experience with subagent workflows
  • Confidence to tackle complex projects
  • A network of professionals on the same journey

Reserve Your Spot →

Ready to Master AI?

Join our self-paced AI course and learn ChatGPT, Claude, and Claude Code with hands-on training.

  • Live instruction
  • Hands-on practice
  • 12-month community access

Frequently Asked Questions

What is the difference between agents and subagents in Claude Code?

An agent is Claude Code itself-the main AI assistant you interact with. A subagent is a specialized worker that Claude spawns to handle specific tasks in isolation, with its own context window. Use subagents for tasks with verbose output, parallel work, or when you want to restrict tool access.

What are Claude Code skills?

Skills are reusable instruction sets that Claude follows automatically. Unlike subagents that run separately, skills are injected into your main conversation when relevant. Create skills for repeated processes like brand voice guidelines, code review checklists, or report formatting.

What is the difference between Skills and CLAUDE.md?

Skills are personal preferences that follow you across projects (brand voice, formatting style). CLAUDE.md is project-specific context that lives in your project folder and is visible to anyone with repo access. Use both together: CLAUDE.md for project context, Skills for personal standards.

What are hooks in Claude Code?

Hooks are automated actions that trigger at specific moments-like before/after file edits or commands. Use hooks for auto-backups, running linters after changes, logging Claude's actions, or notifications when tasks complete.

What is MCP in Claude Code?

MCP (Model Context Protocol) connects Claude to external tools and services like databases, APIs, and custom systems. It's an advanced feature that lets Claude query PostgreSQL directly, post to Slack, or access your company's internal tools.

BONUS RESOURCE

Finished reading?
Take it with you.

Get a downloadable checklist summarizing the key points from Claude Code Agents, Skills, Hooks, and MCP Explained, plus weekly AI tips.

Printable quick-reference guide
Step-by-step action items
Weekly AI insights newsletter

Guide Checklist

PDF + Email Series

No spam. Unsubscribe anytime.