What Makes Claude Code Tick? A Deep Dive into Subagents, Skills, MCP, Slash Commands, Hooks, and Plugins
The article breaks down Claude Code’s six building blocks—Subagents, Skills, Model Context Protocol (MCP), Slash Commands, Hooks, and Plugins—detailing their characteristics, execution methods, programmability, complexity, autonomy, use cases, customization difficulty, persistence, and integration patterns, and concludes with a comparative matrix and key distinctions.
1. Subagents
Subagents are independent AI agents within Claude Code that the main agent can invoke to perform specific tasks. Each subagent has its own system prompt, toolset, and dedicated responsibilities.
Independent AI instance with its own context and instructions
Can recursively call other subagents
Suited for complex tasks requiring diverse expertise
Examples: code‑review subagent, test‑generation subagent, documentation‑generation subagent
Usage example:
# The main agent can call a dedicated subagent for a specific task
"Call the code-reviewer subagent to analyze this pull request"2. Skills
Skills are predefined knowledge packages and best‑practice guides stored as Markdown documents. They provide Claude with domain‑specific expertise and workflows.
Static knowledge base, not executable code
Contains detailed guidance, examples, and best practices
Read and understood before a task starts
Can be public (e.g., docx, pptx skills) or user‑defined
Progressive disclosure
Usage example:
# Claude reads the relevant skill document first
view ~/.claude/skills/docx/SKILL.md
# Then follows the skill guide to execute the task3. Model Context Protocol (MCP)
MCP is an open protocol that lets Claude connect to external data sources and tools, offering a standardized way to extend Claude’s capabilities.
Protocol‑level standard, not a concrete implementation
Enables third‑party tool integration
Supports real‑time data access (e.g., databases, APIs)
Custom tools and resources can be added
Usage example:
# MCP server provides tools for Claude to call
# Example: connect to a PostgreSQL database
# Or access Slack, GitHub, etc.4. Slash Commands
Slash Commands are user‑side shortcuts that trigger specific functions quickly from a command‑line‑like interface.
User‑side quick input method
Predefined command templates
Simplifies triggering common tasks
Directly maps to particular agent behaviors
Usage example:
/review # trigger code review
/test # generate tests
/docs # generate documentation
/refactor # refactor code5. Hooks
Hooks are scripts or functions that automatically fire at specific events or workflow stages.
Event‑driven automation mechanism
Can run before, during, or after a task
Used for workflow integration and automation
Common types: pre‑commit, post‑execution, on‑error
Usage example:
# Example hooks configuration
hooks:
pre-commit:
- run-linter
- check-formatting
post-execution:
- update-documentation
- notify-team6. Plugins
Plugins are modular components that extend Claude Code’s core functionality, allowing new features or third‑party service integrations.
Modular functional extensions
Installable/uninstallable
Can contain UI components, tools, integrations, etc.
Usually developed by the community or third parties
Usage example:
# Install plugins to extend functionality
claude-code install plugin-github-copilot
claude-code install plugin-docker-managerComparative Summary
Nature : Subagents are independent AI agents; Skills are knowledge documents; MCP is a communication protocol; Slash Commands are quick commands; Hooks are event triggers; Plugins are functional modules.
Execution : Subagents use dynamic AI inference; Skills are passively read; MCP performs real‑time tool calls; Slash Commands require user activation; Hooks fire automatically; Plugins load on demand.
Programmability : Subagents are AI‑driven; Skills are static docs; MCP is highly programmable; Slash Commands use predefined templates; Hooks are scriptable; Plugins are fully programmable.
Complexity : Subagents high; Skills low; MCP medium‑high; Slash Commands low; Hooks medium; Plugins medium‑high.
Autonomy : Subagents high (independent decisions); Skills none (guidance only); MCP medium (tool calls); Slash Commands none (user‑triggered); Hooks medium (auto‑executed); Plugins medium (config‑driven).
Main Use Cases : Subagents for complex task decomposition; Skills for domain knowledge transfer; MCP for external integration; Slash Commands for rapid operations; Hooks for CI/CD automation; Plugins for feature extension.
Customization Difficulty : Subagents need prompt engineering; Skills require Markdown authoring; MCP needs protocol implementation; Slash Commands are simple to configure; Hooks need scripting; Plugins require code development.
Persistence : Subagents exist only within a session; Skills are static files; MCP can access persistent data; Slash Commands have no persistence; Hooks can log; Plugins can manage state.
Key Distinctions
Intelligence hierarchy : Subagents > Hooks > Plugins > MCP > Slash Commands > Skills.
Flexibility : MCP and Plugins are the most flexible; Skills are the most fixed.
User involvement : Slash Commands need manual triggering; Hooks and Subagents run automatically.
Extensibility : MCP and Plugins provide the strongest extension capabilities.
Learning curve : Slash Commands are the easiest; Subagents and MCP are the most complex.
These components can work together; for example, a user triggers a Slash Command, the main agent reads a Skill guide, calls a Subagent for a complex task, the Subagent accesses external data via MCP, Hooks perform automatic checks during execution, and Plugins add extra integration features.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
BirdNest Tech Talk
Author of the rpcx microservice framework, original book author, and chair of Baidu's Go CMC committee.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
