Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Subagents Guide

БесплатноБез исполняемых скриптовНе проверен

Specialized AI assistants for task-specific workflows with separate context. Learn when to delegate, configure tools, and apply best practices.

CaptainCrouton89от CaptainCrouton89★ 493 звезды на GitHub25 установок в других каталогах

Об этом скилле

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

Benefit Impact
Context Preservation Main thread stays focused; subagent pollution isolated
Specialized Expertise Domain-tuned instructions improve success rates
Flexible Permissions Grant only necessary tools to each subagent
Reusability One 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

Field Required Notes
name ✓ lowercase, hyphens only; used for invocation
description ✓ Natural language; used for auto-delegation. Use "proactively" to trigger automatic use
tools — Comma-separated list. Omit to inherit all tools from main thread
model — sonnet (default), opus, haiku, or 'inherit' for consistency

File Locations & Priority

Type Location Scope Priority
Project .claude/agents/ This project only Higher
User ~/.claude/agents/ All projects Lower

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 appropria
Полный SKILL.md на GitHub

Установить Subagents Guide в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Glob
Grep
Bash

FAQ

Что делает скилл Subagents Guide?

Specialized AI assistants for task-specific workflows with separate context. Learn when to delegate, configure tools, and apply best practices.

Как установить скилл Subagents Guide?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Subagents Guide запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Subagents Guide с