| Agent Type | Capabilities | Best For | |
|---|---|---|---|
| Explore | Read, Glob, Grep, WebSearch | File search, Read code, Answer codebase questions | Quick exploration, finding patterns |
| Plan | Read, Glob, Grep, WebSearch | Design strategies, Identify files, Consider trade offs | Architecture planning, complex task scoping |
| Bash | Bash only | Run commands, Git operations, Process management | Build, test, deploy, git workflows |
| General Purpose | All tools | Full capability, Multi-step tasks | Complex research, implementation tasks |
| Custom | Configurable | Whatever you define in the agent file | Domain specific tasks, team workflows |
0
Built-in agent types
0x
Faster with parallel agents
0
Extra cost (uses same API)
When to use subagents
Subagents shine when you have independent tasks that can run in parallel. If you need to search three different directories, research an API, and check test coverage all at once, subagents can do all of that simultaneously. They also protect your main conversation context: a subagent doing deep research won't fill up your context window with intermediate results.
Creating a custom agent
Custom agents are markdown files in ~/.claude/agents/. Each file has YAML frontmatter defining the agent's identity and a system prompt body. Here is a simplified example:
---
name: code-reviewer
description: "Reviews code for quality, security, and best practices"
model: opus
tools: Read, Grep, Glob
---
You are a senior code reviewer. When given code or a PR diff:
1. Check for security vulnerabilities (OWASP top 10)
2. Identify performance issues
3. Flag code style violations
4. Suggest concrete improvements with examplesOnce saved, this agent becomes available to Claude Code and can be invoked automatically when a task matches its description, or manually through the Task tool.
No extra cost for subagents
Subagents use the same API credits or subscription quota as the main Claude Code session. Launching five parallel Explore agents costs the same total tokens as running those five searches sequentially. The benefit is speed (parallel execution) and context cleanliness (results stay in the subagent's context until summarized back), not cost savings.