sub-agent-patterns

Explains sub-agent architecture and usage within Claude Code, including custom YAML-defined agents and delegation workflows.

54|Updated Nov 19, 2025
One-click install
npx skills add https://github.com/dennislee928/Ethic-Latex --skill sub-agent-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sub-agent-patterns
Source: https://github.com/dennislee928/Ethic-Latex/tree/main/.claude/skills/sub-agent-patterns
Command: npx skills add https://github.com/dennislee928/Ethic-Latex --skill sub-agent-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance on leveraging Claude's sub-agent system, enabling efficient task delegation, parallel processing, and context management for complex workflows.

Core Features & Use Cases

  • Understand Built-in Agents: Learn about Explore, Plan, and General-Purpose agents for various tasks.
  • Create Custom Agents: Define your own specialized agents with custom prompts, tools, and models.
  • Optimize Delegation: Master patterns for bulk operations, research, and code reviews using sub-agents.
  • Use Case: You need to audit 50 different skills for version accuracy. Instead of doing it manually, you can define a custom skill-auditor agent and delegate the task to it, allowing it to run in parallel and report back findings efficiently.

Quick Start

Use the sub-agent patterns skill to learn how to create a custom code-reviewer agent.

Frequently Asked Questions about sub-agent-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are sub-agents in Claude Code and how do they work?

Sub-agents in Claude Code are specialized delegated agents that handle specific tasks like exploration or planning. They work by using custom prompts, selected tools, and model choices to enable parallel processing and efficient context management for complex workflows.

How do I create a custom agent using YAML configuration?

To create a custom agent, you define a specialized agent using YAML configuration that specifies custom prompts, selects appropriate tools, and assigns a model like Haiku, Sonnet, Opus, or inherit. This configuration enables tailored task delegation and persona-based routing.

Can I use parallel processing to audit multiple files at once with sub-agents?

Yes, you can use sub-agents for parallel processing to audit multiple files. The skill demonstrates defining a custom agent, like a skill-auditor, and delegating bulk operations to run in parallel, efficiently reporting back findings without manual execution.

Which model should I choose for my custom agent: Haiku, Sonnet, or Opus?

Choosing between Haiku, Sonnet, and Opus for a custom agent depends on the complexity of the delegated task. The skill explains model choices and orchestration patterns to optimize workflow, balancing speed and capability for prompt engineering and task delegation.

What's the best way to orchestrate background execution for code reviews?

The best way to orchestrate background execution for code reviews is by applying advanced sub-agent patterns. You can define a custom code-reviewer agent, use persona-based routing, and implement batch sizing and commit strategies to optimize the delegation workflow.

When should I use the built-in Explore or Plan agents versus creating a custom agent?

Use built-in Explore or Plan agents for general exploration and planning tasks, but create a custom agent when you need specialized prompt engineering, specific tool selection, or targeted persona-based routing for complex bulk operations like auditing or code reviews.