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.
8 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-coding-agentic-shell-workflows-creators
What is the main idea of "Agentic Shell Workflows — Claude Code Sub-Agents in Practice"?
Which concept is most central to "Agentic Shell Workflows — Claude Code Sub-Agents in Practice"?
Which use of AI fits this topic best?
What should a careful learner remember about "The 10-agent ceiling"?
You want to use AI after this lesson. What is the safest next step?
How should AI output about sub-agents be treated?
Name one way to verify an AI answer about sub-agents.
Which action would help you apply "Agentic Shell Workflows — Claude Code Sub-Agents in Practice" responsibly?