Best Claude Subagents
Specialized subagents for Claude Code and the Agent SDK.
What are Claude Subagents?
A Claude subagent is a specialized agent that Claude Code can spawn to handle a focused task in isolation: code review, debugging, performance analysis, security scanning, documentation, etc. Each subagent has its own system prompt, its own tool allowlist, and runs in its own context, keeping the main conversation clean while the heavy lifting happens elsewhere.
Subagents are the answer to two problems: context bloat and role blurring. By delegating a discrete piece of work to an agent with a tight scope, you avoid polluting your main thread with tool noise, and you get an agent that's actually good at one job rather than mediocre at ten. Anthropic shipped first-class subagent support in Claude Code; the community has built hundreds of pre-configured agents you can drop into ~/.claude/agents/.
Below you'll find 480+ subagents covering security audits, accessibility reviews, SEO checks, code refactoring, test writing, infrastructure monitoring and more, ranked by stars and recent activity.
Questions about Subagents
How do I install a community subagent?+
Drop the agent's .md file into ~/.claude/agents/ (global) or .claude/agents/ inside your project. Claude Code picks it up automatically the next time it boots. You can also use claude agent install <repo> if a project ships a CLI installer.
When should I use a subagent vs the main Claude conversation?+
Use a subagent when the task is well-defined, would otherwise produce noisy tool calls, or benefits from a tight system prompt, e.g. 'review this PR for security issues' or 'find why my Postgres query is slow'. Use the main conversation for open-ended work, planning and discussion.
Can subagents call each other?+
Yes. A subagent can spawn its own subagent if it has Task in its allowed tools. This is useful for orchestration patterns, a 'lead reviewer' agent can delegate to a 'security' agent, an 'accessibility' agent and a 'performance' agent in parallel.
Is using a subagent more expensive than the main conversation?+
Each subagent invocation is its own message turn, so it's billed independently. But the trade is usually positive: a 5K-token focused subagent run beats a 50K-token main thread that drifted off-task. For high-volume use, route subagents to Haiku or Sonnet to keep costs predictable.
How do I write my own subagent?+
Create a markdown file with frontmatter (name, description, tools, model) plus a system prompt body. Drop it into .claude/agents/. Test it with claude or via Task tool from another agent. The repos in this directory are great references, pick one, fork its style.