MCP, Skills & Subagents
Three ways to extend the agent, one question that tells you which one you need, and the exact commands for all three.
add a working MCP server, write a project skill, delegate a review to a subagent, and prove what each one changed
- Lab 02 finished — a QAIRU Event Sign-up folder that is a git repo with at least one commit
- Lab 03 finished — a CLAUDE.md in that folder
- Claude Code installed and logged in (Pro, Max, Team, Enterprise or Console account)
By now your agent knows your project. It still does not know your tools, your repeated chores, or how to keep its own noise out of its own head. Three features fix exactly those three things — and they are not interchangeable.
Twenty-five minutes. One MCP server, one skill, one delegated review. After each, you check what actually changed — because “I installed a thing” is not a result.
Three problems, three tools, and the question that separates them
The ladder Claude Code is built on: CLAUDE.md is always loaded, skills load on demand, hooks fire deterministically, subagents get a separate context window, and MCP brings in external tools (features overview).
| You are missing | Reach for | What it is |
|---|---|---|
| A system the agent cannot reach: issue tracker, database, browser, live docs | MCP server | An open standard for plugging external tools and data into the agent |
| A chore you re-explain every week: a review format, a release note | Skill | A folder with a SKILL.md; only its description sits in context |
| Work that would flood your conversation: logs, a big search, a diff review | Subagent | A helper with its own context window that hands back a summary |
The question that sorts almost every case: is the missing thing outside your machine (MCP), inside your head (skill), or inside your context window (subagent)?
Add one MCP server: the Claude Code docs
One sentence first: an MCP server gives the agent a tool it did not have — here, a searchable copy of the current Claude Code documentation, so it stops answering from memory. Hosted over HTTP, no authentication, nothing to install.
Add it from your normal shell, not from inside a session
Exit Claude Code first (
/exit).claude mcp addis a shell command.claude mcp add --transport http claude-code-docs https://code.claude.com/docs/mcp claude mcp listThe line for your server should end in
Connected. If not, runclaude mcp listagain — the first handshake can be slow.Ask it something it can only answer from the docs
Start
claude, then run/mcp— you get status, reconnect, authenticate and disable for every server. Now prompt:Use the claude-code-docs server to look up what MCP_TIMEOUT does and when I would need it. Quote the doc, do not guess.Approve the tool call. Watch the label: it carries the server name, so you can always see when an answer came through a tool instead of out of the model.
Check what it cost you
Run
/context. The server barely registers — MCP tool definitions are deferred by default, so only the tool names and the server’s instructions load until a tool is used (costs). The caveat: a CLI tool you already have, such asgh, is still cheaper than an MCP server doing the same job. Add servers you use; disable the rest.Decide who else gets it
Scope is a flag, and the default is narrow.
- no flag →
local: you, this project. Stored in~/.claude.json(%USERPROFILE%\.claude.jsonon Windows). --scope project→ writes.mcp.jsonin the repo root; teammates get an approval prompt.--scope user→ you, every project.
Claude Code does not read
~/.claude/mcp.jsonor any file like it, so do not invent one. To undo:claude mcp remove claude-code-docs.- no flag →
Stretch: a local server that drives a browser (needs Node.js 18+)
claude mcp add playwright -- npx -y @playwright/mcp@latestEverything after
--is the command that starts a local server; forgetting--is the classic mistake. Now ask the agent to open your sign-up page and tell you whether the form actually submits — that is self-verification through a real browser.The first start downloads packages and can time out. PowerShell:
$env:MCP_TIMEOUT = "60000"; claude.
Write one skill: /cc-docs
One sentence: a skill is a folder with a SKILL.md that teaches the agent a procedure once, so you stop re-typing it — and it stays out of your context window until you call it.
In Lab 03 you wrote /preflight, a skill that takes no input. This one takes an argument and drives the server you just added, so the two halves of this lab wire together.
Make the folder
New-Item -ItemType Directory -Force .claude\skills\cc-docsmkdir -p .claude/skills/cc-docsWrite SKILL.md
Create
.claude/skills/cc-docs/SKILL.mdwith exactly this:--- name: cc-docs description: Look up a Claude Code command or setting in the official docs and answer with a quote. Use whenever I ask how something in Claude Code works. argument-hint: what to look up --- Look up "$ARGUMENTS" using the claude-code-docs MCP server. Answer in exactly this shape: 1. One sentence: what it is. 2. The exact command or setting, in a code block. 3. One sentence: when it does not apply, or how it breaks. Quote the docs. If the server does not answer, say so instead of answering from memory.$ARGUMENTSis whatever you type after the command name, so/cc-docs plan modeand/cc-docs Ctrl+Bboth run out of one file.argument-hintrecords what to type after the name. There is nodisable-model-invocationline here on purpose: this skill only reads, so it is safe to let the agent reach for it on its own.Restart and confirm it loaded
Skills are picked up at start, so exit and run
claudeagain. Type/and findcc-docsin the list, or run/skillsto see everything currently loaded.Run it, then ask the same thing in plain English
/cc-docs plan modeYou get three parts, in that order, pulled through the server you added ten minutes ago. Now type
how does plan mode work?as a normal question and compare. The skill did not make the model smarter. It made the output the same shape every time, which is what lets you skim an answer instead of reading it.Or let the agent write the next one
Create a project skill in .claude/skills/ called release-note. It should read the last 5 commits and write a 4-line release note in Kazakh and English for a non-technical reader. Manual invocation only. Show me the SKILL.md before writing it.
Go deeperWhy not just put all of this in CLAUDE.md?
Because CLAUDE.md loads at the start of every session, so every line costs context every time — keep it under 200 lines. Skills use progressive disclosure instead: about 100 tokens of metadata are always loaded, the body (recommended under 5,000 tokens) only when relevant, referenced files only when needed (Agent Skills).
Skills are an open standard, not a Claude-only feature (agentskills.io). Custom slash commands are merged into them now: .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both give you /deploy.
A skill is executable instruction: install only from sources you trust, and read any bundled script before you run it.
Delegate one review to a subagent
One sentence: a subagent is a second Claude with its own context window, system prompt, tool list and permissions — it does the noisy work and returns a summary, so your main conversation stays clean.
Built-in ones are already there: Explore (read-only search), Plan (research during plan mode) and general-purpose. Now define your own.
Commit first — this one matters
git add -A git commit -m "before delegating to a subagent"Subagent edits are usually not restored by
/rewind. Checkpoints are local undo; git is permanent undo. Commit before you delegate, every time.Write the subagent file
Create
.claude/agents/security-reviewer.md:--- name: security-reviewer description: Reviews code for security vulnerabilities tools: Read, Grep, Glob, Bash model: opus --- You are a senior security engineer. Look for injection, auth flaws, secrets in code, insecure data handling. Give line references and fixes.nameanddescriptionare the only required fields. Everything else is a dial:tools,disallowedTools,model,permissionMode,maxTurns,isolation: worktree. For simple helpers,model: haikucuts the bill.Note for anyone following an older tutorial: since v2.1.198
/agentsno longer opens a management panel — it points you at these file locations.Hand it the diff
Use the security-reviewer agent on the diff of my last commit. Check, in this order: 1. Correctness: does it do what CLAUDE.md and the page require? 2. Security: input validation, secrets in code, unsafe defaults. 3. Scope: anything changed that the task did not require? Report only findings that affect correctness, security or the stated requirements. For each: file and line, what breaks, a concrete failing scenario, a suggested fix. Style preferences go in a separate list. If you find nothing serious, say so.You can force it with an
@-mention of the agent name, or run a whole session as it withclaude --agent security-reviewer.Watch where the work happened
While it runs,
/taskslists running work andCtrl+Bsends it to the background. When it returns, run/context: it barely moved, because the grep output and the file reads lived in the subagent’s window, not yours. Then run/usage— on a subscription it attributes usage to skills, subagents and MCP servers separately, so today’s three additions all show up in one place.
Go deeperWhen a subagent is the wrong answer
Anthropic’s January 2026 guidance is blunt about the cost: multi-agent work typically runs 3–10x the tokens of a single agent for the same task, so exhaust single-agent options first. Skip it when a better prompt or a /clear would fix the problem (when and how to use multi-agent systems).
The design rule from the same post is the one people get wrong: decompose by context, not by job title. The agent that builds a feature should also write its tests, because it already holds the context; planner / coder / tester creates handoff loss. Cognition makes it harder — actions carry implicit decisions, and two agents making conflicting ones produce a broken whole (Don’t Build Multi-Agents).
Default: one agent, subagents for research, a fresh-context reviewer. Parallel writers only when they own different files — that is Lab 07.
Outside your machine → MCP server (claude mcp add). Inside your head → skill (.claude/skills/<name>/SKILL.md). Inside your context window → subagent (.claude/agents/<name>.md). Commit before you delegate.
`claude mcp list` prints Connected, `/cc-docs` answers from the documentation instead of from memory, and a subagent hands you a review summary without filling your main context.