
Claude Code Agents, Skills, Hooks, and MCP Explained
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.
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:
| Concept | What It Is | When to Use It |
|---|---|---|
| Agent | Claude Code itself-the main AI assistant | Your default interaction |
| Subagent | A specialized worker that runs separately | Tasks with lots of output, parallel work |
| Skill | Reusable instructions Claude follows automatically | Repeated processes, team standards |
| Hook | Automated trigger that runs at specific moments | Auto-backup, validation, notifications |
| MCP | Connection to external tools and services | Database access, APIs, custom integrations |
| CLAUDE.md | Project-specific instructions file | Per-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:
When the subagent completes, you get a summary-not the full verbose output:
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:
| Subagent | What It Does | Model | Cost |
|---|---|---|---|
| Explore | Fast, read-only codebase search | Haiku | Low |
| Plan | Research and context-gathering for plan mode | Your selected model | Standard |
| General-purpose | Complex multi-step tasks needing exploration + action | Your selected model | Standard |
| Bash | Runs terminal commands in separate context | Your selected model | Standard |
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.
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:
When Claude uses a skill, you'll see it indicated in the conversation:
Skill Levels: Where Do They Live?
Skills can exist at different levels:
| Level | Scope | Use Case |
|---|---|---|
| Personal | Only you, across all projects | Your individual preferences |
| Project | Anyone working in this folder | Project-specific standards |
| Organization | Everyone in your company | Company-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
- Open a new chat at claude.ai
- Type: "Help me build a skill"
- Describe what you want Claude to remember
- Claude generates the skill file
- 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"
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.
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:
| Aspect | Skills | CLAUDE.md |
|---|---|---|
| Scope | Can be personal, project, or org-wide | Always project-specific |
| Location | Stored in Claude's system | Lives in your project folder |
| Portability | Follows you across projects | Stays with the project |
| Visibility | Only Claude sees it | Visible to anyone with repo access |
| Best for | Your personal preferences | Project 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.
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 Type | When It Fires | Example Use |
|---|---|---|
| Pre-edit | Before Claude edits any file | Create automatic backups |
| Post-edit | After Claude edits a file | Run linter, format code |
| Pre-command | Before running a terminal command | Log what's about to run |
| Post-command | After a command completes | Check for errors, notify you |
| Session start | When you begin a Claude Code session | Load 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"
}
}
}
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
| Feature | Purpose | Runs When |
|---|---|---|
| Skills | Add knowledge/instructions | When relevant to your task |
| Subagents | Execute isolated tasks | When Claude delegates work |
| Hooks | Automate actions | At specific trigger points |
Skills tell Claude what to do. Hooks tell Claude what else should happen when it does things.
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
Why Use MCP?
Without MCP, you'd have to:
- Manually export data from your database
- Give Claude the export file
- Ask your question
- Take Claude's answer back to your database
With MCP:
- Ask Claude to query your database directly
- 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
| Feature | What It Extends |
|---|---|
| Skills | Claude's knowledge |
| Subagents | Claude's parallel execution |
| Hooks | Claude's workflow automation |
| MCP | Claude's available tools |
MCP doesn't change how Claude thinks-it gives Claude new things to interact with.
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
| Aspect | Subagents | Skills |
|---|---|---|
| Where it runs | Separate context (isolated) | Main conversation |
| What it returns | Summary only | Full output visible |
| Best for | Execution tasks | Adding knowledge |
| Overhead | Startup cost (new context) | No startup cost |
| Tool access | Can be restricted | Uses 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.
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:
- Create a skill with your report format, required sections, and tone
- Tell Claude Code to use the skill on your latest data export
- 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:
- Claude uses the Explore subagent to search your codebase (fast, cheap)
- Results come back summarized
- 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:
- Spawn three subagents to research each competitor in parallel
- Spawn a fourth subagent to analyze your internal positioning docs
- 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:
- Set up a hook to backup files before any edit
- Create a skill with your code review checklist
- Ask Claude to review the PR using that skill
- 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:
- Connect your database via MCP
- Ask Claude questions in plain English
- Claude writes and runs SQL queries directly
- You get answers without manual exports
Why this works: MCP eliminates the export/import cycle.
Quick Reference
When to Use Each
| Situation | Use This |
|---|---|
| Normal Claude Code tasks | Main agent (default) |
| Tasks with verbose output | Subagent |
| Parallel independent work | Multiple subagents |
| Reusable instructions | Skill |
| Project-specific context | CLAUDE.md |
| Team-wide standards | Skill (org level) |
| Auto-backup or validation | Hook |
| External tool access | MCP |
| Tool restrictions needed | Subagent with limited access |
| Fast codebase searches | Explore subagent |
The Mental Model
- 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:
- Try asking Claude to use a subagent for your next verbose task (test suite, log analysis)
- Create one skill for something you repeat often
- Add a CLAUDE.md file to your main project
- Notice when Claude automatically uses the Explore subagent for searches
Keep learning:
- Ultimate Claude Code Guide - Comprehensive beginner's guide
- Claude Code Plan Mode Tutorial - The 5-minute habit that saves hours
- Claude Code Context Management - Why results degrade and how to fix it
- 50+ Non-Coding Uses - Real examples from non-developers
- Claude Code Setup on Mac - Get started in 15 minutes
- Skills Library - Pre-built skills ready to use
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
Continue Learning
Skills Setup Guide
Complete Guide to Setting Up Claude Code Skills
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.
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.
Guide Checklist
PDF + Email Series
Related Guides
Claude Code Tutorial for Beginners (No Coding Required) - Complete 2026 Guide
Complete Claude Code tutorial for beginners and non-coders. Learn prompts, CLAUDE.md, plan mode, skills, and agents. No coding experience required. Updated for 2026.
Claude Code Skills: The Complete Setup and Creation Guide
Claude Code skills, set up end to end. Install pre-built skills, then write your own custom workflows with SKILL.md. Hands-on, no prior setup assumed.
How to Set Up Claude Code on Mac (2026 Guide)
The easiest Claude Code Mac setup tutorial. Step-by-step from download to first prompt - works on M1, M2 & M3 chips. No coding needed.
Claude Code Context Management: How to Get Better Results
Fix inconsistent Claude Code results with proper context management. Learn when to use /clear, /compact, and session handoffs for better AI output.
What is Claude Code and Why Is Everyone Freaking Out About It?
What is Claude Code? A Google engineer admitted it did in 1 hour what her team took a year to build. Here's what's actually happening—and why you don't need to be technical to use it.