sub-agents

Create and configure Claude Code sub-agents with custom prompts, tools, and models

422 stars

Best use case

sub-agents is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create and configure Claude Code sub-agents with custom prompts, tools, and models

Teams using sub-agents should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/sub-agents/SKILL.md --create-dirs "https://raw.githubusercontent.com/vibeeval/vibecosystem/main/skills/sub-agents/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/sub-agents/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How sub-agents Compares

Feature / Agentsub-agentsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create and configure Claude Code sub-agents with custom prompts, tools, and models

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Sub-Agents Reference

Create specialized AI agents with isolated contexts for specific tasks.

## When to Use

- "How do I create a sub-agent?"
- "Configure agent tools"
- "What built-in agents exist?"
- "Agent model selection"
- "Agent chaining patterns"

## Quick Start

### Interactive (Recommended)
```bash
/agents
```
Opens menu to create, edit, and manage agents.

### Manual Creation
```bash
mkdir -p .claude/agents
cat > .claude/agents/reviewer.md << 'EOF'
---
name: reviewer
description: Code review specialist. Use proactively after code changes.
tools: Read, Grep, Glob, Bash
model: sonnet
---

You are a senior code reviewer focusing on quality and security.

## Review Checklist
- Code clarity and naming
- Error handling
- Security vulnerabilities
- Test coverage
EOF
```

### CLI-Based
```bash
claude --agents '{
  "reviewer": {
    "description": "Code reviewer",
    "prompt": "Review for quality and security",
    "tools": ["Read", "Bash"],
    "model": "sonnet"
  }
}'
```

## Agent File Format

```yaml
---
name: agent-name
description: When/why to use this agent
tools: Read, Edit, Bash      # Optional, inherits all if omitted
model: sonnet                 # sonnet, haiku, claude-opus-4-5-20251101, inherit
---

System prompt content here...
```

## Configuration Fields

| Field | Required | Options |
|-------|----------|---------|
| `name` | Yes | lowercase, hyphens |
| `description` | Yes | When to use |
| `tools` | No | Tool list (inherits all if omitted) |
| `model` | No | `sonnet`, `haiku`, `claude-opus-4-5-20251101`, `inherit` |

## Built-In Agents

| Agent | Model | Tools | Purpose |
|-------|-------|-------|---------|
| General-purpose | Sonnet | All | Complex multi-step tasks |
| Plan | Sonnet | Read-only | Plan mode research |
| Explore | Haiku | Read-only | Fast codebase search |

## Model Selection

| Model | Speed | Best For |
|-------|-------|----------|
| Haiku | Fastest | Search, quick lookups |
| Sonnet | Fast | Most tasks (default) |
| Opus | Slower | Complex reasoning |

## Tool Combinations

```yaml
# Code Reviewer (read-only)
tools: Read, Grep, Glob, Bash

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

# Implementer
tools: Read, Write, Edit, Bash, Glob
```

## Example Agents

### Code Reviewer
```yaml
---
name: code-reviewer
description: Reviews code for quality and security. Use after code changes.
tools: Read, Grep, Glob, Bash
model: sonnet
---

Review code for:
- Security vulnerabilities
- Code quality issues
- Missing error handling
- Test coverage gaps

Output findings by priority: Critical > Warning > Suggestion
```

### Debugger
```yaml
---
name: debugger
description: Debug errors and test failures.
tools: Read, Edit, Bash, Grep, Glob
model: inherit
---

Debugging process:
1. Capture error details
2. Identify failure location
3. Form hypotheses
4. Test and verify
5. Implement fix
```

## File Locations

| Type | Location | Priority |
|------|----------|----------|
| Project | `.claude/agents/` | Highest |
| User | `~/.claude/agents/` | Lower |

## Advanced Patterns

### Resumable Agents
```
[Agent returns agentId: "abc123"]

# Later: resume with context
claude -r "abc123" "Continue analysis"
```

### Agent Chaining
```
Use code-analyzer to find issues,
then use optimizer to fix them
```

## Best Practices

1. **Single responsibility** - One clear purpose per agent
2. **Restrict tools** - Only grant what's needed
3. **Clear descriptions** - Action-oriented, include "proactively"
4. **Version control** - Check `.claude/agents/` into git

Related Skills

parallel-agents

422
from vibeeval/vibecosystem

Parallel Agent Orchestration

no-polling-agents

422
from vibeeval/vibecosystem

No Polling for Background Agents

workflow-router

422
from vibeeval/vibecosystem

Goal-based workflow orchestration - routes tasks to specialist agents based on user goals

wiring

422
from vibeeval/vibecosystem

Wiring Verification

websocket-patterns

422
from vibeeval/vibecosystem

Connection management, room patterns, reconnection strategies, message buffering, and binary protocol design.

visual-verdict

422
from vibeeval/vibecosystem

Screenshot comparison QA for frontend development. Takes a screenshot of the current implementation, scores it across multiple visual dimensions, and returns a structured PASS/REVISE/FAIL verdict with concrete fixes. Use when implementing UI from a design reference or verifying visual correctness.

verification-loop

422
from vibeeval/vibecosystem

Comprehensive verification system covering build, types, lint, tests, security, and diff review before a PR.

vector-db-patterns

422
from vibeeval/vibecosystem

Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.

variant-analysis

422
from vibeeval/vibecosystem

Find similar vulnerabilities across a codebase after discovering one instance. Uses pattern matching, AST search, Semgrep/CodeQL queries, and manual tracing to propagate findings. Adapted from Trail of Bits. Use after finding a bug to check if the same pattern exists elsewhere.

validate-agent

422
from vibeeval/vibecosystem

Validation agent that validates plan tech choices against current best practices

tracing-patterns

422
from vibeeval/vibecosystem

OpenTelemetry setup, span context propagation, sampling strategies, Jaeger queries

tour

422
from vibeeval/vibecosystem

Friendly onboarding tour of Claude Code capabilities for users asking what it can do.