Loading lesson…
Sub-agents turn Claude Code from a coding assistant into a small engineering team that works in parallel. Let's build a real sub-agent workflow end to end.
A sub-agent is a separately-scoped Claude instance spawned by your main session to handle a focused job. Up to 10 can run in parallel. Each has its own system prompt, tool access, and MCP servers. You stop being one person typing and become an orchestrator directing specialists.
# .claude/agents/explorer.md
---
name: explorer
description: Map unfamiliar code — summarize files, identify entry points, trace data flow
tools:
- Read
- Grep
- Glob
mcpServers:
# Explorer gets read-only GitHub access; no edit privileges.
github-readonly:
command: npx
args: ["-y", "@modelcontextprotocol/server-github", "--readonly"]
---
You are an exploration agent. Your job:
1. Read files requested by the parent agent.
2. Produce concise, structured summaries.
3. Cite file paths and line numbers for every claim.
4. Never edit files — explore only.One markdown file, one scoped agent. Frontmatter controls tools and MCP access.| Pattern | Use case |
|---|---|
| Fan-out | Split a job across N agents, merge results (explore 10 directories) |
| Pipeline | Sequence of specialized agents (planner → coder → tester → reviewer) |
| Supervisor | Main agent supervises narrow workers (main plans, subagents execute) |
| Sandbox | Run risky commands in a scoped subagent with limited tools |
You (in main Claude Code session):
"Use the explorer agent to summarize each of these 5 files in parallel:
src/auth/login.ts, src/auth/signup.ts, src/auth/reset.ts,
src/auth/sessions.ts, src/auth/middleware.ts
Then synthesize a single auth-system overview."
Claude (main):
Spawns 5 explorer subagents, one per file, in parallel.
Receives 5 summaries in ~30 seconds total.
Synthesizes a cross-file overview citing each summary.A task that would take 5 minutes of serial reading done in 30 seconds of parallel subagents.The best subagent designs restrict capabilities. An explorer that can only read. A tester that can only run tests. A deployer that can only run deploy scripts. Scoping prevents a single hallucinated command from wrecking your repo, and it makes audit trails trivial.
You are no longer a typist. You are a conductor.
— A Claude Code power user
The big idea: sub-agents transform Claude Code from assistant to orchestra. Define specialists, give each the minimum tools it needs, and compose them into workflows that are faster and safer than any single agent could be.
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-coding-agentic-shell-workflows-creators
What is the core idea behind "Agentic Shell Workflows — Claude Code Sub-Agents in Practice"?
Which term best describes a foundational idea in "Agentic Shell Workflows — Claude Code Sub-Agents in Practice"?
A learner studying Agentic Shell Workflows — Claude Code Sub-Agents in Practice would need to understand which concept?
Which of these is directly relevant to Agentic Shell Workflows — Claude Code Sub-Agents in Practice?
Which of the following is a key point about Agentic Shell Workflows — Claude Code Sub-Agents in Practice?
Which of these does NOT belong in a discussion of Agentic Shell Workflows — Claude Code Sub-Agents in Practice?
Which statement is accurate regarding Agentic Shell Workflows — Claude Code Sub-Agents in Practice?
Which of these does NOT belong in a discussion of Agentic Shell Workflows — Claude Code Sub-Agents in Practice?
What is the key insight about "The 10-agent ceiling" in the context of Agentic Shell Workflows — Claude Code Sub-Agents in Practice?
What is the key insight about "Cost scales with parallelism" in the context of Agentic Shell Workflows — Claude Code Sub-Agents in Practice?
Which statement accurately describes an aspect of Agentic Shell Workflows — Claude Code Sub-Agents in Practice?
What does working with Agentic Shell Workflows — Claude Code Sub-Agents in Practice typically involve?
Which of the following is true about Agentic Shell Workflows — Claude Code Sub-Agents in Practice?
Which best describes the scope of "Agentic Shell Workflows — Claude Code Sub-Agents in Practice"?
Which section heading best belongs in a lesson about Agentic Shell Workflows — Claude Code Sub-Agents in Practice?