Guide for creating effective Claude Code agents. This skill should be used when users want to create a new agent (or update an existing agent) that configures Claude with specialized system prompts, tool restrictions, model selection, and MCP/skill integrations.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
LICENSE.txtassets/templates/code-reviewer.mdassets/templates/frontend-specialist.mdassets/templates/prompt-engineer.mdassets/templates/researcher.mdreferences/agent-patterns.mdreferences/opus-prompting.mdreferences/tool-catalog.mdscripts/init_agent.pyThis skill provides guidance for creating effective Claude Code agents.
Agents are Markdown files with YAML frontmatter that configure Claude Code with specialized behavior. They can be used in two ways:
claude --agent name) - Starts Claude Code as this personaUnlike skills (which inject knowledge into context), agents fundamentally change who Claude is for that session - the system prompt, available tools, and even the model.
| Use Case | Create Agent? | Alternative |
|---|---|---|
| Specialized persona with restricted tools | Yes | - |
| Domain expert needing specific MCPs/skills | Yes | - |
| Cost optimization (haiku for simple tasks) | Yes | - |
| Orchestrator that delegates to sub-agents | Yes | - |
| Adding domain knowledge to context | No | Create a skill |
| One-off task instructions | No | Direct prompting |
| Reusable scripts/assets | No | Create a skill |
Agents can load skills. Skills cannot become agents.
Agents are stored as .md files in:
~/.claude/agents/ - User-level (global, all projects).claude/agents/ - Project-level (repo-specific, higher precedence)---
name: agent-name
description: "When to use this agent. Be specific about triggers."
---
System prompt content goes here.
| Field | Required | Type | Description |
|---|---|---|---|
name | Yes | string | Unique ID (lowercase, hyphens only) |
description | Yes | string | When/why to invoke this agent |
tools | No | list | Restrict to specific tools only |
model | No | string | haiku, sonnet, opus, or omit to inherit |
permissionMode | No | string | default, acceptEdits, plan, bypassPermissions |
skills | No | list | Auto-load specific skills |
Omitting tools grants all available tools. Specifying it creates a whitelist:
tools:
- Read
- Grep
- Glob
Common tools: Read, Write, Edit, Glob, Grep, Bash, Task, WebSearch, WebFetch, TodoWrite
See references/tool-catalog.md for the complete catalog with use cases.
Before writing, answer:
Run the initialization script to scaffold the agent file:
python ~/.claude/skills/agent-creator/scripts/init_agent.py <agent-name> [--path <directory>]
Default path is ~/.claude/agents/ (user-level). Use .claude/agents/ for project-level.
The system prompt (Markdown body after frontmatter) defines the agent's behavior. Follow Opus 4.5 prompting best practices from references/opus-prompting.md.
---
name: example-agent
description: "..."
---
[Role statement - who this agent is]
## Capabilities
[What this agent can do]
## Guidelines
[How to approach tasks]
## Workflow
[Step-by-step process if applicable]
Match tools to the agent's purpose:
| Agent Type | Recommended Tools | Model |
|---|---|---|
| Researcher | Read, Grep, Glob, WebSearch, WebFetch | sonnet |
| Code Reviewer | Read, Grep, Glob, Bash | sonnet |
| Writer/Editor | Read, Write, Edit | sonnet |
| Quick Search | Grep, Glob, Read | haiku |
| Complex Analysis | Read, Grep, Glob, Task | opus |
| Orchestrator | Task, Read, TodoWrite | opus |
For agents that need external capabilities:
skills:
- ui-styling
- docs-seeker
Reference skills in the system prompt:
## Available Skills
Use the `ui-styling` skill for shadcn components and Tailwind.
Use the `docs-seeker` skill for finding library documentation.
For MCP tools, mention them explicitly in the system prompt so the agent knows they're available.
claude --agent your-agentClaude Opus 4.5 has specific characteristics that affect agent design. See references/opus-prompting.md for full details.
Include this in agents that write code:
Avoid over-engineering. Only make changes directly requested or clearly necessary.
Keep solutions simple and focused. Do not add features, refactor code, or make
improvements beyond what was asked.
See references/agent-patterns.md for common archetypes:
Before finalizing an agent: