* fix(shellcheck): declare and assign separately in router.sh (SC2155) * feat(plugin): enhance context management and skill invocation - Update .context-manifest.json to include profile and detailed source information. - Revise context-scout.md to clarify context root discovery and navigation. - Modify commands to replace deprecated skills with updated ones (brainstorming → approach, systematic-debugging → debugger). - Streamline install-context.md for clarity and remove interactive profile selection. - Improve oac-status.md to provide a more comprehensive status report. - Add OAC system paths to session-start.sh for better context management. - Remove obsolete skills and improve documentation for existing commands.
1.7 KiB
1.7 KiB
Creating Subagents
Purpose: Step-by-step guide to create custom subagents
Interactive Method (/agents)
- Run
/agentsin Claude Code - Select Create new agent
- Choose scope: User-level or Project-level
- Select Generate with Claude and describe the subagent
- Select tools (or keep all)
- Choose model
- Pick a color
- Save - available immediately
Manual Method (Markdown File)
Create file at ~/.claude/agents/ (personal) or .claude/agents/ (project):
---
name: code-reviewer
description: Reviews code for quality and best practices
tools: Read, Glob, Grep
model: sonnet
---
You are a code reviewer. Analyze code and provide specific,
actionable feedback on quality, security, and best practices.
Restart session or use /agents to load.
CLI Method (JSON)
claude --agents '{
"code-reviewer": {
"description": "Expert code reviewer",
"prompt": "You are a senior code reviewer...",
"tools": ["Read", "Grep", "Glob", "Bash"],
"model": "sonnet"
}
}'
Session-only, not saved to disk.
Key Points
- Filename becomes subagent name (without
.md) - Description determines when Claude delegates
- Body becomes system prompt
- Subagents only get their system prompt, not full Claude Code prompt
- Include "use proactively" in description for automatic delegation
Related
../concepts/subagents-system.md- Subagents overview../lookup/subagent-frontmatter.md- All configuration fields../examples/subagents/- Example subagents
Reference: https://docs.anthropic.com/en/docs/claude-code/sub-agents