Claude Code Agents: 30 Ready-to-Use Subagents for Code Review, Testing, Security and More
A free, open-source collection of Claude Code agents (subagents) (custom agents defined as .claude/agents/*.md files) for everyday software work: code review, security audits, test writing, debugging, CI fixes, SQL tuning, database migrations, Terraform and Kubernetes reviews, incident response, prompt reviews, internationalization, accessibility, docs, changelogs and release checks. It is for developers who use Claude Code and want well-scoped specialist agents they can drop into a project, install as a plugin, or use as templates for their own.
Every agent here is written from scratch, kept short enough to read in a minute, limited to the tools it actually needs, and checked by a small validator with tests.
Last reviewed: December 2026. Frontmatter fields and plugin formats were checked against the Claude Code documentation at that date. Claude Code changes quickly, so check the subagents docs if something behaves differently.
Contents
- What is a Claude Code subagent?
- Quick start
- The agent catalog
- How to use subagents well
- Anatomy of a subagent file
- Frontmatter reference
- Choosing tools: least privilege recipes
- Choosing a model
- Writing your own subagent
- Workflow patterns
- Validate your agents
- Troubleshooting
- FAQ
- Repository layout
- Contributing
- License
- More free resources
What is a Claude Code subagent?
A subagent is a separate Claude instance that the main Claude Code session can hand a task to. Each subagent has:
- Its own context window. It reads files, runs searches and thinks without filling up your main conversation. Only its final answer comes back.
- Its own system prompt. The Markdown body of the file tells it how to work, what to check and how to report.
- Its own tool permissions. You can give a reviewer read-only tools and give a test writer edit access.
- Optionally its own model. A cheap, fast model for searching logs; a stronger one for architecture or security.
Claude decides when to delegate based on each agent’s description, or you can ask for one by name (“use the security-auditor subagent on the auth module”).
Subagents are useful when a task is self-contained and produces a summary: a review, an audit, an investigation, a plan. They are less useful for work where you want to watch every step, or for tiny tasks where the hand-off costs more than it saves.
Quick start
Option A: copy the files you want
Project-level agents live in .claude/agents/ and can be committed so your whole team gets them. Personal agents live in ~/.claude/agents/ and are available in every project.
# Get the repository
git clone https://github.com/Ralpberry-Labs/claude-code-agents.git
# Add a few agents to the current project (shared with your team via git)
mkdir -p .claude/agents
cp claude-code-agents/agents/{code-reviewer,test-writer,debugger}.md .claude/agents/
# Or install all of them for yourself, in every project
mkdir -p ~/.claude/agents
cp claude-code-agents/agents/*.md ~/.claude/agents/
Claude Code watches these folders, so new files are usually picked up without a restart. Run /agents inside Claude Code to see and manage what is loaded.
If two agents share a name, the more specific location wins: project agents override personal ones, and both override plugin agents.
Option B: install as a plugin
This repository is also a Claude Code plugin marketplace. Inside Claude Code:
/plugin marketplace add Ralpberry-Labs/claude-code-agents
/plugin install specialist-subagents@ralpberry-subagents
Or from your shell:
claude plugin marketplace add Ralpberry-Labs/claude-code-agents
claude plugin install specialist-subagents@ralpberry-subagents
Plugin agents are namespaced, so they appear as specialist-subagents:code-reviewer and so on. Note that, for security reasons, Claude Code ignores the hooks, mcpServers and permissionMode fields in agents that come from plugins. None of the agents here rely on them.
Option C: try one for a single session
The --agents flag accepts agent definitions as JSON for one session only, which is handy for experiments:
claude --agents '{
"quick-reviewer": {
"description": "Reviews the current diff for bugs. Use after code changes.",
"prompt": "You are a strict code reviewer. Review git diff HEAD and list real bugs with file:line.",
"tools": ["Read", "Grep", "Glob", "Bash"],
"model": "sonnet"
}
}'
The agent catalog
All files are in agents/. Tools are the allowlist in each file’s frontmatter; “inherit” means the agent uses the same model as your main session.
Code quality
| Agent | What it does | Tools | Model |
|---|---|---|---|
| code-reviewer | Reviews the current diff for bugs, security issues, missing tests and maintainability, ranked by severity with path:line |
Read, Grep, Glob, Bash | inherit |
| security-auditor | Traces untrusted input to dangerous sinks, checks authz, secrets and crypto, runs installed audit tools | Read, Grep, Glob, Bash | opus |
| test-writer | Writes deterministic tests in the project’s existing framework; reproduces bugs with a failing test first | Read, Grep, Glob, Edit, Write, Bash | inherit |
| refactorer | Behaviour-preserving refactors in small steps, running tests after each | Read, Grep, Glob, Edit, Bash | inherit |
| performance-profiler | Measures first (profilers, benchmarks, query plans), then optimizes the hot path and reports before/after numbers | Read, Grep, Glob, Edit, Bash | inherit |
| dependency-auditor | Finds vulnerable, outdated, duplicate and unused dependencies and proposes the smallest safe upgrade set | Read, Grep, Glob, Bash, WebFetch | sonnet |
Debugging and operations
| Agent | What it does | Tools | Model |
|---|---|---|---|
| debugger | Reproduce, hypothesize, confirm, minimal fix, verify; never silences errors | Read, Grep, Glob, Edit, Bash | inherit |
| flaky-test-hunter | Loops a test to measure flakiness, finds ordering, timing, time zone or shared-state causes, fixes them | Read, Grep, Glob, Edit, Bash | inherit |
| ci-fixer | Reads failing CI logs, reproduces the exact command locally, fixes causes without weakening checks | Read, Grep, Glob, Edit, Bash | inherit |
| log-analyst | Summarizes huge logs with targeted grep/jq pipelines: timeline, first error, top signatures |
Read, Grep, Glob, Bash | haiku |
| dockerfile-reviewer | Image size, layer caching, non-root user, secrets, exec-form entrypoints, compose hygiene | Read, Grep, Glob, Edit, Bash | sonnet |
| release-checker | Pre-release checklist with evidence and a GO / NO-GO verdict; never tags or deploys | Read, Grep, Glob, Bash | sonnet |
| incident-responder | Timeline, ranked causes, safest mitigation, status updates and a blameless postmortem; recommends, never acts | Read, Grep, Glob, Bash | opus |
Infrastructure
| Agent | What it does | Tools | Model |
|---|---|---|---|
| terraform-reviewer | Destructive replacements, public exposure, encryption, secrets, pinning and cost in Terraform/OpenTofu; never applies | Read, Grep, Glob, Bash | sonnet |
| kubernetes-reviewer | Renders Helm/Kustomize, then checks images, resources, probes, security contexts, RBAC, PDBs and rollouts | Read, Grep, Glob, Bash | sonnet |
Design and planning
| Agent | What it does | Tools | Model |
|---|---|---|---|
| architect | Options, recommended design, step-by-step plan, rollout and risks; read-only | Read, Grep, Glob, WebFetch | opus |
| api-designer | REST/GraphQL/RPC design and review: status codes, errors, pagination, idempotency, evolution | Read, Grep, Glob, Edit, Write | inherit |
| migration-planner | Zero-downtime schema changes using expand-contract, lock analysis and rollback plans | Read, Grep, Glob | opus |
| sql-optimizer | Reads query plans, proposes indexes and rewrites, removes N+1 queries | Read, Grep, Glob, Bash | sonnet |
| adr-writer | Writes Architecture Decision Records in your repo’s format, or a sensible default | Read, Grep, Glob, Write | sonnet |
Front end
| Agent | What it does | Tools | Model |
|---|---|---|---|
| accessibility-auditor | WCAG 2.2 AA audit: semantics, labels, keyboard, focus, contrast, ARIA, target size | Read, Grep, Glob, Edit, Bash | sonnet |
| ui-reviewer | Design-system usage, spacing, typography, loading/empty/error states, responsive layout | Read, Grep, Glob, Bash | sonnet |
| i18n-auditor | Hard-coded strings, concatenation, plurals, locale formatting, RTL and missing translation keys | Read, Grep, Glob, Bash | sonnet |
AI features
| Agent | What it does | Tools | Model |
|---|---|---|---|
| prompt-reviewer | Reviews prompts and tool schemas in your app for clarity, output contracts, injection risk and testability | Read, Grep, Glob | sonnet |
Documentation and collaboration
| Agent | What it does | Tools | Model |
|---|---|---|---|
| codebase-explorer | Fast read-only answers to “where is X / how does Y work” with file paths | Read, Grep, Glob | haiku |
| onboarding-guide | Setup, daily commands, architecture tour and conventions for new contributors | Read, Grep, Glob, Bash | sonnet |
| docs-writer | READMEs, how-tos, reference and docstrings verified against the code | Read, Grep, Glob, Edit, Write, Bash | sonnet |
| pr-describer | Pull request title and body from the branch diff; uses your PR template if present | Read, Grep, Glob, Bash | haiku |
| commit-message-writer | Commit message for staged changes in your repo’s convention | Bash, Read | haiku |
| changelog-writer | User-facing release notes grouped by Added, Changed, Fixed and so on | Read, Grep, Glob, Bash | sonnet |
How to use subagents well
Let Claude delegate automatically. Claude reads every agent’s description and picks one when a task matches. Descriptions in this collection say both what the agent does and when to use it, which is what makes automatic delegation work. Words like “use proactively after…” encourage Claude to call an agent without being asked.
Ask explicitly when it matters. Natural language works:
Use the security-auditor subagent to review the changes in src/auth/.
Have the codebase-explorer find where webhook signatures are verified.
Run the release-checker before I tag v2.3.0.
Run independent agents in parallel. Asking for several unrelated investigations at once (“have the code-reviewer review the diff while the test-writer adds tests for parser.py”) lets Claude run them side by side.
Keep the main thread for decisions. A good rhythm is: explore with codebase-explorer, plan with architect, implement in the main session, then verify with code-reviewer and test-writer. Your main context stays focused on the decisions instead of on raw file dumps.
Give the agent what it cannot discover. Subagents start fresh. They do not see your earlier conversation unless Claude passes it along. Mention constraints explicitly: “the API must stay backward compatible”, “do not touch the generated client”.
Treat agent output as a draft. An agent’s confidence is not evidence. The agents here are told to cite path:line, show commands they ran and say what they did not check, so you can verify quickly.
Anatomy of a subagent file
A subagent is a Markdown file with YAML frontmatter. Only name and description are required.
---
name: code-reviewer
description: Reviews a diff for correctness bugs and risky changes. Use proactively after code changes.
tools: Read, Grep, Glob, Bash
model: inherit
color: blue
---
You are a senior code reviewer...
## Scope
...
## What to look for
...
## How to report
...
- The file name does not have to match
name, but keeping them equal avoids confusion (the validator warns when they differ). - The body is the agent’s whole system prompt. Write it as instructions to a capable colleague who has never seen your project.
- Project and personal agent folders are scanned recursively, so you can organize agents in subfolders;
namemust still be unique within a folder.
Frontmatter reference
These are the fields documented for Claude Code subagents at the time of review. Unknown fields are ignored silently, so a typo will not raise an error; the validator in this repo catches common mistakes.
| Field | Required | Meaning |
|---|---|---|
name |
yes | Unique identifier. Use lowercase words and hyphens. It cannot contain : or start with -. |
description |
yes | When Claude should delegate to this agent. Keep it short and action-oriented. |
tools |
no | Allowlist, as a comma-separated string or a YAML list. Omit it to inherit all tools available to subagents. |
disallowedTools |
no | Denylist, applied before tools. |
model |
no | sonnet, opus, haiku, fable, a full model ID, or inherit. |
permissionMode |
no | default, acceptEdits, auto, dontAsk, bypassPermissions, plan, or manual. Ignored for plugin agents. |
maxTurns |
no | Maximum number of agentic turns before the agent stops. |
skills |
no | Skills to preload into the agent’s context at startup. |
mcpServers |
no | MCP servers available to the agent. Ignored for plugin agents. |
hooks |
no | Lifecycle hooks scoped to the agent. Ignored for plugin agents. |
memory |
no | Persistent memory scope: user, project or local. |
background |
no | true to always run the agent in the background. |
effort |
no | Reasoning effort: low, medium, high, xhigh or max. |
isolation |
no | worktree runs the agent in a temporary git worktree. |
color |
no | Display colour: red, blue, green, yellow, purple, orange, pink or cyan. |
Agents in this collection deliberately use only name, description, tools, model and color, the most portable subset.
Choosing tools: least privilege recipes
Every tool you grant is something the agent can do without your main session noticing until the result comes back. Grant the minimum.
| Agent type | Suggested tools |
Why |
|---|---|---|
| Pure explorer or planner | Read, Grep, Glob |
Cannot change anything or run commands |
| Reviewer that runs linters or git | Read, Grep, Glob, Bash |
Shell for git diff and test runs; prompt says “do not modify files” |
| Implementer (tests, fixes, refactors) | Read, Grep, Glob, Edit, Bash |
Can edit existing files and verify |
| Writer that creates new files | add Write |
Needed only to create files |
| Researcher | add WebFetch and/or WebSearch |
For checking current versions, advisories, docs |
| Agent that orchestrates others | add Agent(name-a, name-b) |
Restrict which agent types it may spawn |
| MCP access | add mcp__server__* |
Grants that server’s tools only |
Two notes:
Bashis powerful. A prompt that says “read-only” is guidance, not enforcement. For hard guarantees, leaveBashout, or use permission rules in your settings to deny specific commands.disallowedToolsis handy when you want “everything except”: for exampledisallowedTools: Write, Editon an otherwise inherited tool set.
Choosing a model
The model field accepts an alias (haiku, sonnet, opus, fable), a full model ID, or inherit. Rules of thumb used in this collection:
- Fast and cheap (
haiku) for high-volume, low-judgment work: searching, summarizing logs, writing commit messages and PR descriptions. - Balanced (
sonnet) for most review and writing tasks. - Strongest (
opus) where a miss is expensive: security audits, migrations on live databases, architecture. inheritfor agents that implement changes, so they match whatever model you chose for the session.
If you set the CLAUDE_CODE_SUBAGENT_MODEL environment variable, it applies to agents without their own model field. Change the model lines freely to fit your budget.
Writing your own subagent
A good subagent is narrow, verifiable and honest about its limits. This checklist is what every agent in the collection follows.
- One job. “Reviews SQL migrations for lock and data-loss risks” beats “database helper”. Narrow agents get picked at the right time and produce focused output.
- A description with a trigger. State what it does and when to use it: “Use when…”, “Use proactively after…”. This is the only thing Claude sees when deciding to delegate.
- A process, not a personality. Numbered steps beat adjectives. “Run the failing test 50 times and count failures” is more useful than “you are an expert at flaky tests”.
- Evidence rules. Require
path:line, exact commands and their results, and a section listing what was not checked. - Clear boundaries. Say what the agent must never do: edit files, deploy, weaken tests, print secrets.
- An output format. Tell it exactly how to report so the result is easy for the main session (and you) to use.
- Least privilege tools. See the table above.
- Short. Most agents here are 30 to 60 lines. Long prompts dilute the important rules.
A template to start from:
---
name: your-agent-name
description: <What it does in one sentence>. Use when <trigger situation>.
tools: Read, Grep, Glob
model: sonnet
---
You are <role>. Your goal is <outcome>.
## Steps
1. <First thing to gather or check>
2. <How to analyze>
3. <How to verify>
## Rules
- <Hard boundary, e.g. never modify files>
- <Evidence requirement, e.g. cite path:line for every finding>
## Report
- <Exact sections of the answer>
- <What to say when nothing is wrong>
Workflow patterns
Explore, plan, implement, verify
1. codebase-explorer: "How do we currently send emails? List the files."
2. architect: "Plan adding per-user email preferences. Reuse what exists."
3. (main session) implement step 1 of the plan
4. test-writer: "Add tests for the new preferences service."
5. code-reviewer: "Review the diff."
Bug triage
debugger -> root cause and minimal fix
test-writer -> regression test that fails before the fix
code-reviewer -> check the fix did not break callers
Pre-release
dependency-auditor -> vulnerabilities and upgrades
changelog-writer -> release notes since the last tag
release-checker -> GO / NO-GO with evidence
Parallel review
Ask for several reviewers at once when changes are large: code-reviewer for logic, security-auditor for input handling, accessibility-auditor for new UI. Each returns an independent report, and none of them fills your main context with the files it read.
Commit as a team default
Commit .claude/agents/ to your repository so everyone (and CI-driven sessions) gets the same agents. Personal tweaks can go in ~/.claude/agents/ under a different name.
Subagents vs skills, commands, hooks and MCP
Claude Code has several ways to customize behaviour. They solve different problems and combine well:
| Feature | What it is | Runs in | Best for | Example |
|---|---|---|---|---|
Subagent (.claude/agents/*.md) |
A specialist with its own prompt, tools and context window | A separate context; returns a summary | Self-contained tasks that read a lot and report back | security-auditor reviews a module |
Skill (.claude/skills/<name>/SKILL.md) |
Instructions plus optional scripts and reference files, loaded when relevant | The current conversation | Reusable know-how and workflows | A “release notes” skill with a template |
Slash command (.claude/commands/*.md) |
A saved prompt you trigger by name (now part of the skills system) | The current conversation | Repeated prompts you start on purpose | /fix-issue 123 |
Hook (settings hooks) |
A command Claude Code runs automatically on events such as before or after a tool call | Outside the model, deterministic | Rules that must always happen | Run the formatter after every edit |
| MCP server | External tools and data over the Model Context Protocol | A separate process or service | Access to systems (databases, issue trackers, APIs) | Query production metrics |
| CLAUDE.md | Project instructions loaded every session | The current conversation | Conventions and commands for the repo | “Use pnpm, run pnpm test” |
Rules of thumb:
- If it must happen every time without exception, use a hook, not a prompt.
- If it is knowledge or a procedure, use a skill or CLAUDE.md.
- If it is a job that reads a lot and returns a verdict, use a subagent.
- If it needs access to an external system, use an MCP server (and give only the relevant subagents its tools).
Best picks by situation
| Situation | Start with | Why |
|---|---|---|
| Solo developer, any project | code-reviewer, test-writer, debugger |
Highest daily value, low risk |
| Team repository | Add pr-describer, commit-message-writer, onboarding-guide |
Consistent collaboration artifacts |
| Before a release | dependency-auditor, changelog-writer, release-checker |
Evidence-based go/no-go |
| Backend with a database | sql-optimizer, migration-planner |
The most expensive mistakes live here |
| Front-end product | ui-reviewer, accessibility-auditor, i18n-auditor |
Catches what demos hide |
| Platform and infrastructure | terraform-reviewer, kubernetes-reviewer, dockerfile-reviewer |
Blast radius awareness before apply |
| AI features in your app | prompt-reviewer |
Prompts are code; review them like code |
| On call | incident-responder, log-analyst |
Structure under pressure |
Validate your agents
scripts/validate_agents.py checks agent files using only the Python standard library:
- frontmatter exists and parses
nameanddescriptionare present;nameis lowercase-hyphenated and unique per folderdescriptionmentions when to use the agent and is not overly longtoolsanddisallowedToolsuse known tool names (MCP tools andTool(args)forms are allowed)model,colorandpermissionModeuse documented values- the system prompt body is not trivially short
python3 scripts/validate_agents.py # validates ./agents
python3 scripts/validate_agents.py .claude/agents ~/.claude/agents
python3 -m unittest discover -s tests -v # run the validator's tests
To check the plugin manifests too, run Claude Code’s own validator:
claude plugin validate .
Troubleshooting
My agent never gets picked automatically. Make the description more specific about the trigger (“Use when a test fails intermittently”), and avoid two agents with overlapping descriptions. You can always name the agent explicitly.
The agent does not appear in /agents. Check that the file starts with --- on the first line, that the frontmatter closes with ---, and that name and description are set. Run the validator.
It used a tool I did not expect. If tools is omitted, the agent inherits all tools available to subagents. Add an explicit tools line.
Two agents with the same name. The higher-priority location wins: managed settings, then --agents, then project .claude/agents/, then ~/.claude/agents/, then plugins.
Plugin agent ignores its hooks or permissionMode. That is by design for plugin agents. Copy the file into .claude/agents/ if you need those fields.
The agent’s answer lacks context from our conversation. Subagents start with a fresh context. Ask Claude to include the relevant details when delegating, or put stable project facts in CLAUDE.md.
FAQ
Are these official? No. This is an independent community collection. Claude Code and Claude are products of Anthropic.
Do subagents cost more? Each subagent call uses its own tokens. They often save tokens overall by keeping your main context small, and cheaper models for simple agents (haiku) help further. Avoid spawning agents for one-line tasks.
Can a subagent call another subagent? Only if its tools allow the Agent tool. Use Agent(name-a, name-b) to restrict which ones.
Can I use these with other agent tools? The prompts are plain Markdown and work as system prompts almost anywhere, but the frontmatter fields and tool names are specific to Claude Code.
Should I commit agents to my repo? Yes for project-specific agents your team should share. Keep personal preferences in ~/.claude/agents/.
How many subagents should I install? Install the handful you will actually use. Every agent’s description is visible to Claude when it decides whether to delegate, so dozens of overlapping agents make choices noisier.
Can a subagent use MCP tools? Yes. Subagents inherit MCP tools unless tools restricts them; list mcp__server__* in tools to grant one server’s tools explicitly.
Can subagents edit files in parallel safely? Parallel read-only agents are safe. For parallel editing, use isolation: worktree (each agent gets a temporary git worktree) or give agents non-overlapping files.
How do I make an agent run in the background? Set background: true in its frontmatter, or ask Claude to run it in the background.
Do these work with the Claude Agent SDK? The SDK supports defining subagents programmatically; the prompts here can be reused as their system prompts, with tool names adapted to your setup.
Where to go next
- Claude Code docs: subagents, skills, hooks, plugins, MCP, permissions and settings
- Anthropic engineering: Claude Code best practices and Effective context engineering for AI agents
- AGENTS.md, a cross-tool convention for agent instructions in repositories
- Companion repos from Ralpberry Labs: UI/UX Design Skill (an Agent Skill for front-end work), Spec Kit Guide (spec-driven workflows for agents), and Claude Memory Patterns
Repository layout
claude-code-agents/
├── .claude-plugin/
│ ├── plugin.json # plugin manifest (name: specialist-subagents)
│ └── marketplace.json # marketplace manifest (name: ralpberry-subagents)
├── agents/ # 30 subagent definitions
├── scripts/
│ └── validate_agents.py # stdlib-only frontmatter validator
├── tests/
│ └── test_validate_agents.py
├── LICENSE
└── README.md
Contributing
Pull requests are welcome. To add or change an agent:
- Keep it to one job, with a description that says when to use it.
- Grant only the tools it needs.
- Make every command and fact in the prompt accurate; do not rely on tools that most projects will not have without saying so.
- Run
python3 scripts/validate_agents.pyandpython3 -m unittest discover -s tests. - Add it to the catalog table in this README.
Bug reports about agents that misbehave are just as welcome. Please include the prompt you gave and what the agent did.
License
MIT.
If this collection saved you time, a star helps others find it.
More free resources
Part of the Ralpberry Labs open-source collection. See also Top 100 Open Source.