Back to Skills

sub-agents

verified

How to create and use specialized subagents in Claude Code for task delegation. Use when user asks about creating specialized agents, delegating tasks, agent configuration, or subagent features.

View on GitHub

Marketplace

claude-plugins

reggiechan74/claude-plugins

Plugin

claude-code-metaskill

Repository

reggiechan74/claude-plugins

plugins/claude-code-metaskill/skills/sub-agents/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/reggiechan74/claude-plugins/blob/main/plugins/claude-code-metaskill/skills/sub-agents/SKILL.md -a claude-code --skill sub-agents

Installation paths:

Claude
.claude/skills/sub-agents/
Powered by add-skill CLI

Instructions

# Subagents

## Overview
Subagents are specialized AI assistants that Claude Code can delegate tasks to. Each operates with its own context window, custom system prompt, and configurable tool access.

## Key Features

**Context Management**: Each subagent operates in its own context, preventing pollution of the main conversation

**Specialization**: Task-specific configurations enable higher success rates on designated work

**Reusability**: Once created, subagents work across different projects and teams

**Flexible Permissions**: Individual tool access control per subagent

## Quick Start

1. Run `/agents` command
2. Select "Create New Agent"
3. Choose project-level or user-level scope
4. Define purpose, select tools, customize system prompt
5. Save and invoke automatically or explicitly

## Configuration

### File Locations
- **Project subagents**: `.claude/agents/`
- **User subagents**: `~/.claude/agents/`
- Project-level takes precedence over user-level

### File Format
Markdown with YAML frontmatter containing:
- `name`: Unique identifier
- `description`: Purpose and invocation guidance
- `tools`: Optional comma-separated list
- `model`: Optional model alias (sonnet/opus/haiku) or 'inherit'

### Example Structure
```yaml
---
name: code-reviewer
description: Expert code review specialist. Use proactively after code changes.
tools: Read, Grep, Glob, Bash
model: inherit
---

Your system prompt explaining the subagent's role and approach...
```

## Available Tools

When configuring subagents, you can grant access to these tools via the `tools` field in frontmatter:

### Tools That Require Permission

**Bash** - Executes shell commands in your environment
- Use for: Running tests, git commands, build scripts
- Example: `Bash`

**Edit** - Makes targeted edits to specific files
- Use for: Code modifications, refactoring
- Example: `Edit`

**NotebookEdit** - Modifies Jupyter notebook cells
- Use for: Data science workflows, notebook updates
- Example: `NotebookEdit`

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4983 chars