sub-agent-patterns
Delegate specialized tasks to isolated AI assistants with custom tools, models, and system prompts.
- Sub-agents preserve main context by isolating verbose tool outputs and intermediate reasoning, enabling longer sessions and cleaner conversations
- Three built-in agents available: Explore (Haiku, read-only codebase search), Plan (Sonnet, plan-mode research), and General-Purpose (Sonnet, full read/write access)
- Create custom agents in
.claude/agents/with YAML frontmatter and markdown prompts; omit thetoolsfield entirely to inherit all tools including MCP integrations - Orchestrate multi-phase workflows by adding the Task tool to an agent's configuration, enabling parallel execution and synthesis across specialists
- Avoid Bash approval spam by removing Bash from tools lists unless the agent genuinely needs CLI execution; default to Write/Edit tools for file operations
This skill uses Claude hooks which can execute code automatically in response to events. Review carefully before installing.
Sub-Agents in Claude Code
Status: Production Ready ✅ Last Updated: 2026-02-02 Source: https://code.claude.com/docs/en/sub-agents
Sub-agents are specialized AI assistants that Claude Code can delegate tasks to. Each sub-agent has its own context window, configurable tools, and custom system prompt.
Why Use Sub-Agents: Context Hygiene
The primary value of sub-agents isn't specialization—it's keeping your main context clean.
Without agent (context bloat):
Main context accumulates:
├─ git status output (50 lines)
├─ npm run build output (200 lines)
More from jezweb/claude-skills
tailwind-v4-shadcn
|
2.7Ktanstack-query
|
2.5Kshadcn-ui
Install and configure shadcn/ui components for React projects. Guides component selection, installation order, dependency management, customisation with semantic tokens, and common UI recipes (forms, data tables, navigation, modals). Use after tailwind-theme-builder has set up the theme infrastructure, when adding components, building forms, creating data tables, or setting up navigation.
2.5Ktailwind-theme-builder
>
2.2Kfastapi
|
2.0Kcolor-palette
>
1.9K