About

How to Create Custom Agents in Claude Code

Claude Code

One .md in .claude/agents — name, color, tools, permissions, model

Custom agents are Claude Code instances specialized for specific tasks. Each agent can have its own set of available tools, pre-approved/blocked tools, permission modes, and models. You can also set a default agent via the "agent" field in settings.json or the --agent flag.

How to Use

1

Create .md files in .claude/agents/ directory (filename = agent name)

2

Define agent name, color, tool set, permission mode, and model in Markdown

3

Check available agent list with /agents command

4

Set default agent via "agent" field in settings.json or --agent flag

Tags

#agent #subagent #customization #workflow

Source

Boris Cherny (@bcherny)

← Claude Code Plugins: Installing MCP Servers, Skills and Agents Pre-Approving Permissions in Claude Code with /permissions →