Lesson 50 of 2116
Claude Code CLI as an Agent Platform
Claude Code isn't just a coding assistant — it's a general agent runtime with MCP, subagents, hooks, and skills. Treat it that way and you get a free, powerful platform.
Lesson map
What this lesson covers
Learning path
The main moves in order
- 1More than a coding tool
- 2Claude Code
- 3subagents
- 4hooks
Concept cluster
Terms to connect while reading
Section 1
More than a coding tool
Claude Code ships as a developer CLI, but underneath it's a general agent platform: model router, tool protocol (MCP), project memory (CLAUDE.md), subagents, hooks, skills. If you're already paying for Claude, Claude Code is the cheapest way to ship a real agent in-house.
The five extension points
Compare the options
| Point | What it does | File location |
|---|---|---|
| CLAUDE.md | Persistent project/user memory (context on every turn). | ~/.claude/CLAUDE.md, ./CLAUDE.md |
| MCP config | Connect tool servers. | ~/.claude/claude_desktop_config.json |
| Subagents | Task-scoped agents with isolated context. | .claude/agents/*.md, ~/.claude/agents/*.md |
| Hooks | Shell commands on events (SubagentStart, PreToolUse, Stop). | .claude/settings.json hooks block |
| Skills | Folders of instructions + resources Claude pulls in as needed. | .claude/skills/*/ |
Custom subagent example
A subagent definition. Save as .claude/agents/accessibility-reviewer.md. Invoke from main Claude Code with /agents or @accessibility-reviewer.
---
name: accessibility-reviewer
description: Reviews web UI for WCAG 2.2 compliance.
tools: Read, Grep, Glob, WebFetch
model: claude-sonnet-4-6
---
You are a strict WCAG 2.2 accessibility reviewer.
For any files or URLs given, check:
1. Color contrast ratios (4.5:1 body, 3:1 large).
2. Semantic HTML (headings, landmarks, labels).
3. Keyboard navigation (focus order, skip links, traps).
4. Alt text on images (descriptive, not filename).
5. Form labels and error states.
Report: issues as markdown table (severity / location / fix).
Never modify files. Read-only review.Hooks for safety
Hooks: block dangerous bash commands, notify on task completion. Shell scripts the harness runs.
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{
"type": "command",
"command": "./.claude/hooks/block-rm-rf.sh"
}]
}
],
"Stop": [
{
"hooks": [{
"type": "command",
"command": "osascript -e 'display notification \"Claude done\" with title \"CC\"'"
}]
}
]
}
}MCP in Claude Code
MCP servers declared in claude_desktop_config.json (global) or .mcp.json (project) become available as tools inside every Claude Code session and to every subagent (unless you restrict via the tools frontmatter field). This is how you give an agent Supabase, GitHub, or your private internal API access.
Skills — the agent-skills primitive
Skills are folders under .claude/skills/ or ~/.claude/skills/. Each skill has a SKILL.md with a description; Claude pulls it in when the description matches the user's task. Perfect for domain knowledge ('how our billing works', 'our code style guide') that shouldn't bloat CLAUDE.md.
A skill definition. Claude uses it automatically when the description matches.
# .claude/skills/deploy-runbook/SKILL.md
---
description: Use this skill when the user asks to deploy, release, or
push to production. Knows our specific deploy flow and gotchas.
---
# Deploy Runbook
Our deploy is a three-step GitHub Actions workflow:
1. Tag `vX.Y.Z` on main — triggers CI.
2. CI runs tests + builds artifacts.
3. Approval gate in GitHub Environments: prod requires a second reviewer.
Never run `kubectl apply` directly. Never edit prod secrets from CLI.
Rollback: `./scripts/rollback.sh <prev-tag>`.Common patterns
- Project-specific subagents in .claude/agents/ (code reviewer, test writer, doc updater).
- Org-wide subagents in ~/.claude/agents/ (security reviewer, deploy assistant).
- Private MCP servers for internal APIs — auth via env vars in claude_desktop_config.json.
- Hooks that post to Slack or a message queue on Stop (chain agents across sessions).
- Skills for domain knowledge (style guides, runbooks) that loads lazily.
Claude Code is underrated as an agent platform. If your team is already on Claude, skip the framework selection rabbit hole for internal automation — use the CLI.
Key terms in this lesson
End-of-lesson quiz
Check what stuck
15 questions · Score saves to your progress.
Tutor
Curious about “Claude Code CLI as an Agent Platform”?
Ask anything about this lesson. I’ll answer using just what you’re reading — short, friendly, grounded.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Creators · 50 min
Tool Use at the API Level: The Primitive
Underneath every agent framework is the same primitive — the model returns a structured tool call, you execute it, you feed the result back. Master this loop and every framework looks familiar.
Creators · 75 min
Capstone: Build and Ship a Real Agent
Everything comes together. Design, code, test, secure, and ship a production-quality agent with open-source code you can fork today.
Creators · 48 min
Computer Use API: Letting AI Click Through GUIs
Computer Use lets Claude see your screen and use it — mouse, keyboard, apps. The capability is real, the gotchas are real. A hands-on look at what works in 2026.
