Claude Code's Agent Features (Using Sub-agents)
Claude Code goes beyond a mere "dialogue CLI," with a Sub-agent feature that runs multiple agents in parallel itself. It can speed up large tasks.
What Is a Sub-agent
A mechanism where the main Claude Code session (orchestrator) calls child agents handling specific tasks. Parallel execution shortens time; context separation raises accuracy.
Typical Use
1. Parallel Research
> I want to write this project's API documentation. > Investigate each endpoint in parallel. → Claude Code spins up 5 Sub-agents, each handling a different endpoint, aggregating results.
2. Refactor Division
> Make all TypeScript files strict-mode compliant. > Process in parallel by module with Sub-agents.
3. Parallelizing Test Generation
> Add tests to each file in src/utils/*. > 1 Sub-agent per file.
Sub-agent Definition (Project-Specific)
In the .claude/agents/ directory, you can define specialist Sub-agents.