Manages AI subagents with specific tool permissions and independent contexts to assist with development tasks.

Install

mkdir -p .claude/skills/subagent-name && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8306" && unzip -o skill.zip -d .claude/skills/subagent-name && rm skill.zip

Installs to .claude/skills/subagent-name

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Specialized AI assistants for task-specific workflows with separate context. Learn when to delegate, configure tools, and apply best practices.
143 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Delegate tasks to specialized AI assistants with separate context
  • Configure custom system prompts for subagents
  • Grant granular tool permissions to individual subagents
  • Reuse subagent configurations across projects and teams
  • Automatically delegate tasks based on description matching
  • Explicitly invoke specific subagents for tasks

How it works

Subagents are pre-configured AI personalities defined in Markdown files with YAML frontmatter, each operating with its own context, system prompt, and dedicated tools, allowing for delegation of specific task types.

Inputs & outputs

You give it
Task description, subagent configuration (name, description, tools, model, system prompt)
You get back
Task handled by a specialized AI assistant with isolated context and specific tool access

When to use subagent-name

  • Isolating task context
  • Delegating specialized coding tasks
  • Managing parallel task workflows

About this skill

Subagents Guide

What Are Subagents?

Subagents are pre-configured AI personalities that Claude Code delegates to handle specific task types. Each operates independently with:

  • Separate context — Prevents main conversation pollution, keeps focus on high-level objectives
  • Custom system prompt — Guides behavior for specific domains
  • Dedicated tools — Granular permission control per subagent
  • Reusability — Available across projects, shareable with teams

Key Benefits

BenefitImpact
Context PreservationMain thread stays focused; subagent pollution isolated
Specialized ExpertiseDomain-tuned instructions improve success rates
Flexible PermissionsGrant only necessary tools to each subagent
ReusabilityOne config used across projects and teams

When to Use Subagents

Delegate when:

  • Task matches a pre-defined expertise area
  • You want isolated context for deep work
  • Multiple independent tasks can run in parallel
  • Tool access should be restricted
  • You need consistent behavior across projects

Don't delegate:

  • Simple one-off changes (≤3 files)
  • Active debugging with rapid iteration
  • Tasks requiring main conversation context

Quick Start

# Open subagents interface (Recommended approach)
/agents

# Or create manually: project subagents go here
mkdir -p .claude/agents

# User subagents (available everywhere)
mkdir -p ~/.claude/agents

Steps:

  1. Run /agents command
  2. Select "Create New Agent"
  3. Describe purpose, select tools, customize system prompt
  4. Save — subagent is now available

File Format

Subagents are Markdown files with YAML frontmatter:

---
name: subagent-name
description: When this subagent should be used and its expertise area
tools: Read, Write, Bash  # Optional — inherit all if omitted
model: sonnet            # Optional — sonnet, opus, haiku, or 'inherit'
---

Your system prompt goes here. Define role, capabilities, constraints,
and specific instructions. Include examples, checklists, and best practices.

Configuration Fields

FieldRequiredNotes
namelowercase, hyphens only; used for invocation
descriptionNatural language; used for auto-delegation. Use "proactively" to trigger automatic use
toolsComma-separated list. Omit to inherit all tools from main thread
modelsonnet (default), opus, haiku, or 'inherit' for consistency

File Locations & Priority

TypeLocationScopePriority
Project.claude/agents/This project onlyHigher
User~/.claude/agents/All projectsLower

Project subagents override user-level ones with the same name.

Tool Configuration Best Practices

Principle: Least Privilege

Only grant tools necessary for the subagent's purpose. This:

  • Improves security and focus
  • Prevents unintended actions
  • Makes subagent behavior more predictable

Common tool combinations:

# Code reviewer
tools: Read, Grep, Glob, Bash

# Data analyst
tools: Read, Write, Bash

# Test automation
tools: Bash, Read, Edit, Write

# Debugger
tools: Read, Edit, Bash, Grep, Glob

# Documentation writer
tools: Read, Write, Glob, Grep

Omit tools to let subagent inherit all (including MCP tools).

Invocation Methods

Automatic Delegation

Claude Code proactively delegates when:

  • Task description matches subagent purpose
  • Subagent description field matches context
  • Appropriate tools are configured

To encourage automatic use, include "proactively" in description:

description: Use proactively to run tests and fix failures

Explicit Invocation

Request a subagent directly:

Use the code-reviewer subagent to check my recent changes
Have the debugger investigate this test failure
Ask the data-scientist subagent for a SQL analysis

Example Subagents

Code Reviewer

---
name: code-reviewer
description: Expert code review specialist. Use proactively after writing code.
tools: Read, Grep, Glob, Bash
model: inherit
---

You are a senior code reviewer ensuring high standards of code quality and security.

When invoked, run git diff to identify recent changes and review modified files.

Review checklist:
- Readability and naming
- No duplicated code
- Proper error handling
- No exposed secrets
- Input validation implemented
- Test coverage adequate
- Performance considerations addressed

Organize feedback by priority:
- Critical issues (must fix)
- Warnings (should fix)
- Suggestions (consider improving)

Include specific examples for all recommendations.

Test Automation

---
name: test-runner
description: Test automation expert. Use proactively to run tests and fix failures.
tools: Bash, Read, Edit
---

You are a test automation specialist. When you see code changes, proactively run appropriate tests.

If tests fail:
1. Analyze failure messages and logs
2. Identify root cause
3. Fix the issue while preserving test intent
4. Re-run tests to confirm

For each failure, provide:
- Root cause explanation
- Code fix
- Prevention recommendations

Focus on fixing the underlying issue, not just symptoms.

Debugger

---
name: debugger
description: Debugging specialist. Use proactively when encountering errors or unexpected behavior.
tools: Read, Edit, Bash, Grep, Glob
---

You are an expert debugger specializing in root cause analysis.

Debugging process:
1. Capture error message and stack trace
2. Identify reproduction steps
3. Isolate the failure location
4. Implement minimal fix
5. Verify solution works

For each issue, provide:
- Root cause explanation with evidence
- Specific code fix
- Testing approach
- Prevention recommendations

Focus on fixing the underlying issue, not just symptoms.

Best Practices

Design focused subagents

  • Single, clear responsibility per subagent
  • Improves performance and predictability
  • Easier to test and iterate

Write detailed system prompts

  • Include specific instructions and examples
  • Define constraints and decision rules
  • More guidance = better performance

Limit tool access intentionally

  • Only grant necessary tools
  • Improves security and focus
  • Prevents unintended side effects

Start with Claude-generated agents

  • Generate initial subagent with Claude, then customize
  • Provides solid foundation for iteration
  • Better results than building from scratch

Version control project subagents

  • Check .claude/agents/ into git
  • Team benefits from shared, improved subagents
  • Track subagent evolution over time

Use specific descriptions for auto-delegation

  • Include action verbs: "use proactively", "automatically", "must be used"
  • Match task keywords from your workflow
  • Example: "Use proactively to analyze errors and fix bugs"

Advanced: Chaining Subagents

For complex workflows, sequence multiple subagents:

> First use the code-analyzer subagent to find performance issues,
  then use the optimizer subagent to fix them

Each subagent completes its work, then the next is invoked with its results.

Performance Considerations

Latency trade-off:

  • Subagents preserve main context (allows longer sessions)
  • Each subagent invocation requires initial context gathering
  • Suitable for focused, substantial work (not quick tweaks)

When to use subagents: Substantial work, deep investigation, complex logic, long tasks When to skip: Quick edits (≤3 files), rapid iteration, simple clarifications

Management

Using /agents Command (Recommended)

/agents

Provides interactive interface to:

  • View all available subagents
  • Create new subagents with guided setup
  • Edit existing subagents and tool permissions
  • Delete custom subagents
  • See active subagents when duplicates exist

Direct File Management

Create project subagent:

mkdir -p .claude/agents
cat > .claude/agents/test-runner.md << 'EOF'
---
name: test-runner
description: Use proactively to run tests and fix failures
---

[Your system prompt here]
EOF

Create user subagent:

mkdir -p ~/.claude/agents
# Create file same way as project subagent

Related Documentation

When not to use it

  • For simple one-off changes involving three or fewer files
  • During active debugging with rapid iteration
  • For tasks requiring the main conversation context

Limitations

  • Subagents require explicit configuration
  • Automatic delegation depends on description matching
  • Latency trade-off for subagent invocation

How it compares

This skill enables the creation and management of specialized AI assistants with isolated contexts and toolsets, providing more focused and secure task execution compared to a single, general-purpose AI.

Compared to similar skills

subagent-name side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
subagent-name (this skill)010moReviewIntermediate
using-superpowers953moNo flagsBeginner
ultrawork112moNo flagsAdvanced
clawhub252moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by CaptainCrouton89

View all by CaptainCrouton89

reviewing-code

CaptainCrouton89

Systematically evaluate code changes for security, correctness, performance, and spec alignment. Use when reviewing PRs, assessing code quality, or verifying implementation against requirements.

21105

railway-cli-management

CaptainCrouton89

Deploy, manage services, view logs, and configure Railway infrastructure. Use when deploying to Railway, managing environment variables, viewing deployment logs, scaling services, or managing volumes.

9139

writing-like-user

CaptainCrouton89

Emulate the user's personal writing voice and style patterns. Use when the user asks to write content in their voice, draft documents, compose messages, or requests "write this like me" or "in my style."

687

gathering-requirements

CaptainCrouton89

Systematically clarify user needs, preferences, and constraints before planning or implementation. Classifies work type, investigates existing systems, discovers edge cases and integration points, resolves assumptions, and creates detailed specifications. Use when building features, enhancements, or integrations where requirements need clarification.

31

auditing-security

CaptainCrouton89

Identify and remediate vulnerabilities through systematic code analysis. Use when performing security assessments, pre-deployment reviews, compliance validation (OWASP, PCI-DSS, GDPR), investigating known vulnerabilities, or post-incident analysis.

10

documenting-code

CaptainCrouton89

Maintain project documentation synchronized with code. Keep feature specs, API contracts, and README current with init-project standards. Use when updating docs after code changes, adding new features, or ensuring documentation completeness.

14

You might also like

using-superpowers

obra

Use when starting any conversation - establishes mandatory workflows for finding and using skills, including using Skill tool before announcing usage, following brainstorming before coding, and creating TodoWrite todos for checklists

95205

ultrawork

Yeachan-Heo

Parallel execution engine for high-throughput task completion

11184

clawhub

openclaw

Use the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawhub CLI.

25151

skill-installer

openai

Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).

29141

continuous-learning

affaan-m

Automatically extract reusable patterns from Claude Code sessions and save them as learned skills for future use.

995

memory-keeper-proactive-context-maintenance

b4CU-R4U

Automatically detect and maintain memory freshness by monitoring context staleness, significant code changes, task completions, and phase transitions. Proactively suggests and executes memory sync operations with user confirmation. Use when the user says "sync memory", "update context", or when the Skill detects that context is stale (>2 hours), significant changes have occurred (new commits), tasks completed, or major milestones reached. Replaces passive "context is stale" warnings with active maintenance.

694

Search skills

Search the agent skills registry