Claude Code Explained: Skills, MCP, and Hooks — What They Do and When to Use Each
All articles

Claude Code Explained: Skills, MCP, and Hooks — What They Do and When to Use Each

Claude Code has three extension mechanisms that most developers confuse for each other. Skills, MCP servers, and hooks operate at fundamentally different layers. Here is exactly how they work and when each one is the right tool.

A

Admin

Author

4 April 20266 min read2 views00

What is Claude Code?

Claude Code is Anthropic's CLI-based AI coding assistant — a terminal-native tool that can read codebases, write and edit files, run commands, and complete multi-step engineering tasks autonomously.

Unlike chat-based AI tools, Claude Code operates inside your development environment. It has access to your file system, your shell, and your tools — and it can use them in sequence to complete tasks that would take a developer significant time.

The most powerful aspect of Claude Code is its extensibility. Three mechanisms let you customise how it behaves: Skills, MCP servers, and Hooks. They are frequently confused for each other. They should not be — they operate at entirely different layers.


The three layers of Claude Code extension

Think of them as a stack:

Layer Mechanism Question it answers
Top Skills How should Claude approach this type of task?
Middle MCP What external tools can Claude use?
Bottom Hooks What must always happen at specific lifecycle events?

Each layer does something fundamentally different. Using the wrong one for a given problem is like using a hammer to fix a software bug.


What are Claude Code Skills?

Skills are reusable markdown files that teach Claude how to perform specific workflows. They live in ~/.claude/skills/ and are written in plain markdown — no SDK, no API key, no build step required.

A skill contains instructions, context, and examples that Claude loads when it detects the skill is relevant to the current task. The detection happens through progressive disclosure:

  1. Claude scans skill metadata (name + description) — approximately 100 tokens per skill, always in context
  2. If a skill matches the current task, Claude loads the full instructions
  3. Claude follows the skill's guidance throughout the task

When to use Skills: when you want Claude to follow a specific workflow repeatedly. Code review processes, deployment checklists, architecture patterns, brand voice guidelines, testing standards — anything you would otherwise explain in a prompt every single time.

Example skill: a code-reviewer.md skill that instructs Claude to always check for security vulnerabilities, test coverage, and naming conventions before approving any code change.

Skills are under 2,000 tokens for best performance. Longer skills eat context without proportional benefit.


What is MCP (Model Context Protocol)?

MCP (Model Context Protocol) is an open standard that allows Claude Code to connect to external tools and data sources. An MCP server exposes a set of tools — functions with defined inputs and outputs — that Claude can invoke during a task.

Think of MCP servers as plugins that expand what Claude can do:

  • A Slack MCP server lets Claude send messages, read channels, create threads
  • A database MCP server lets Claude query and modify database records
  • A GitHub MCP server lets Claude create PRs, review code, manage issues
  • A web search MCP server lets Claude retrieve live information from the internet

MCP servers communicate with Claude Code via a standardised JSON protocol. You configure which servers Claude Code has access to in your settings file. Claude then sees those tools available during any conversation and can choose to invoke them.

When to use MCP: when Claude needs to interact with an external system. If the action requires accessing something outside your local file system — sending a message, querying an API, reading from a database — MCP is the right tool.

Key distinction from Skills: MCP gives Claude new capabilities. Skills give Claude new knowledge and workflows. A skill cannot send a Slack message. An MCP server cannot teach Claude how to do a code review.


What are Hooks?

Hooks are shell commands that execute automatically at specific lifecycle events in Claude Code. They run regardless of what Claude is doing and do not require Claude's involvement — they are triggered by the system, not by Claude's decisions.

The lifecycle events where hooks can trigger:

  • PreToolUse — before Claude executes any tool (file read, bash command, web fetch)
  • PostToolUse — after a tool execution completes
  • Notification — when Claude produces a notification
  • Stop — when a Claude response ends

When to use Hooks: for mandatory, unconditional processes. Linting after every file edit. Logging all bash commands for audit purposes. Notifying a Slack channel when Claude completes a task. Running tests automatically after code changes.

The key word is unconditional. Hooks do not require Claude to decide to run them — they fire on the event trigger regardless. This makes them appropriate for compliance requirements, audit trails, and quality gates that must apply universally.

Key distinction from Skills: a skill asks Claude to remember to run tests. A hook actually runs them regardless of what Claude decides.


How Skills, MCP, and Hooks work together

A real-world example: you want Claude Code to review pull requests, post results to Slack, and log all actions for compliance.

  • Skill: pr-reviewer.md — teaches Claude your specific review criteria, what to look for, how to structure feedback
  • MCP server: Slack MCP — gives Claude the ability to post messages to channels
  • Hook: PostToolUse → log all file reads and bash commands to your audit log

Each piece does what it is designed for. The skill handles workflow. The MCP server handles external capability. The hook handles mandatory automation.


What is CLAUDE.md and how does it relate?

CLAUDE.md files serve a different purpose from skills: they are project-specific instructions that Claude reads at the start of every conversation in that repository. They communicate codebase conventions, architecture decisions, commands to run, and anything Claude should know about this specific project.

Skills are global (apply across all projects). CLAUDE.md is local (applies to this project). Both are markdown. Neither replaces the other.


The honest assessment of Claude Code in 2026

Claude Code is the most capable AI coding assistant currently available. Its context window (extended context via the claude-opus-4-6 model), its ability to work across multiple files simultaneously, and its autonomous task completion make it qualitatively different from autocomplete-based tools.

The learning curve is real. The extension mechanisms (Skills, MCP, Hooks) require upfront configuration that takes time. The developers who build that configuration once and maintain it are consistently reporting 3–5x productivity multipliers on complex engineering tasks.

The developers who skip the configuration are using an expensive autocomplete. The difference is the setup.

A

Admin

Contributing writer at Algea.

More articles →

0 Comments

Team members only — log in to comment.

No comments yet. Be the first!