OpenClawCLI GuideFebruary 18, 2026·9 min read

How to Add Agents in OpenClaw: The Complete agents add Guide

Everything you need to know about adding, configuring, and managing agents in OpenClaw. From your first agent to a full multi-agent workspace.

Adding Your First Agent

The openclaw agents add command is how you create new agents in your OpenClaw workspace. Each agent gets its own directory with a SOUL.md file that defines its identity, rules, and capabilities. Here is the basic flow:

Terminal
# Add a new agent with a name
openclaw agents add content-writer

# OpenClaw creates:
#   agents/content-writer/
#   agents/content-writer/SOUL.md

# Start chatting with your new agent
openclaw agent --agent content-writer --message "Hello"

# Or open an interactive session
openclaw agent --agent content-writer

That's it. One command creates the agent. The generated SOUL.md is a starter template that you should customize with your specific requirements. For a deep dive into writing effective SOUL.md files, see our complete SOUL.md guide.

The agents add Command: Full Syntax

The command accepts several options to configure your agent during creation:

Command Syntax
openclaw agents add <agent-name> [options]

Options:
  --model <provider>    Set the model provider
                        (anthropic, openai, google, ollama)
  --workspace <path>    Target workspace directory
  --template <name>     Use a pre-built template

Examples:
  openclaw agents add seo-analyst
  openclaw agents add researcher --model ollama
  openclaw agents add pm --template coordinator

The agent name should be descriptive and use lowercase with hyphens. Good names: content-writer, seo-analyst, data-reporter. Avoid generic names like agent1. For the full CLI reference, see our OpenClaw CLI cheat sheet.

Setting Up Authentication

After adding an agent, you need to configure which language model it will use. OpenClaw supports multiple providers:

Anthropic (Claude)

openclaw models auth paste-token --provider anthropic
# Paste your API key when prompted

Best for writing, reasoning, and complex instructions

OpenAI (GPT-4o)

openclaw models auth paste-token --provider openai
# Paste your API key when prompted

Strong general-purpose model with vision capabilities

Google (Gemini)

openclaw models auth paste-token --provider google
# Paste your API key when prompted

Multimodal capabilities and long context windows

Ollama (Local)

# No API key needed — just install Ollama
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.1

Free, runs locally, no data leaves your machine

For a zero-cost setup with Ollama, read our guide to running OpenClaw with Ollama.

Customizing Your Agent's SOUL.md

The SOUL.md file is where you define everything about your agent. After running openclaw agents add, open the generated file and customize it:

agents/content-writer/SOUL.md
# ContentWriter

## Role
You are a content marketing specialist. You write
blog posts, social media copy, and email campaigns
for a SaaS product.

## Personality
- Tone: Professional but approachable
- Style: Clear, concise, scannable
- Always back claims with data or examples

## Rules
- ALWAYS respond in English
- Target 1,200-1,800 words for blog posts
- Include H2 headers every 200-300 words
- NEVER use clickbait titles
- Include a meta description (max 155 chars)

## Tools — USE THEM
- Use Browser to research topics before writing
- Use Slack to notify when a draft is ready

## Handoffs
- Ask @SEOAnalyst for keyword research
- Hand off finished drafts to @SEOAnalyst

The key to a good agent is being specific. Vague instructions like "be helpful" produce generic results. Specific rules like "Target 1,200-1,800 words" and "Include H2 headers every 200-300 words" produce consistent, high-quality output. For more templates and examples, check our 10 ready-to-use SOUL.md templates.

Adding Multiple Agents

Most teams run 3-10 agents that specialize in different tasks. Here is how to build a content team:

Terminal — Adding a 5-agent content team
# Add each agent
openclaw agents add pm
openclaw agents add content-writer
openclaw agents add seo-analyst
openclaw agents add researcher
openclaw agents add social-media

# List all agents
openclaw agents list

# Your workspace now looks like:
# agents/
#   pm/SOUL.md
#   content-writer/SOUL.md
#   seo-analyst/SOUL.md
#   researcher/SOUL.md
#   social-media/SOUL.md

Once you have multiple agents, you can enable agent-to-agent communication so they collaborate autonomously. Learn how in our agent-to-agent communication guide and agent teams guide.

Managing Your Agents

After adding agents, here are the commands you will use most:

# List all agents in your workspace
openclaw agents list

# Send a message to a specific agent
openclaw agent --agent seo-analyst --message "Analyze keywords for AI agents"

# Restart the gateway (picks up SOUL.md changes)
openclaw gateway restart

# Check agent status
openclaw gateway status

# Remove an agent
rm -rf agents/<agent-name>

Troubleshooting Common Issues

Agent not responding after agents add

Run 'openclaw gateway restart' to reload the agent configuration. The gateway needs to detect the new agent directory.

Auth error when chatting with agent

Run 'openclaw models auth paste-token --provider <your-provider>' to configure the API key. Check that the provider name matches your SOUL.md model setting.

Agent ignores its SOUL.md rules

Use stronger language in SOUL.md: 'ALWAYS', 'NEVER', 'MUST'. Vague instructions get ignored. Also ensure your SOUL.md is under 100 lines — very long files dilute important rules.

Multiple agents can't communicate

Enable agent-to-agent communication in your agents.md configuration file. Each agent needs a ## Handoffs section in its SOUL.md specifying which agents to delegate to.

Skip the Manual Setup: Use CrewClaw

If you want to skip the manual SOUL.md writing, CLI commands, and configuration steps, CrewClaw generates complete agent packages visually. Pick a role, configure integrations, and download a ready-to-deploy package. Your SOUL.md, tools configuration, and workspace setup are all handled automatically.

Frequently Asked Questions

What does openclaw agents add do?

The 'openclaw agents add' command creates a new agent in your OpenClaw workspace. It generates a directory with a SOUL.md file (the agent's identity and rules), sets up the default model configuration, and registers the agent with your gateway. After running the command, you can immediately start chatting with the agent or configure it further.

How many agents can I add to OpenClaw?

There is no hard limit on the number of agents you can run in OpenClaw. You can add as many agents as your server can handle. Each agent consumes memory when active, and each conversation uses API tokens from your configured model provider. In practice, teams run 3-15 agents depending on their workflow. The limiting factor is typically API cost, not OpenClaw itself.

Can I use different models for different agents?

Yes. Each agent can use a different model provider and model. You configure this in the agent's settings or SOUL.md. For example, your content writer might use Claude for nuanced writing, your data analyst might use GPT-4o for code generation, and your research agent might use a local Ollama model to save costs. Set the model with 'openclaw config set agents.defaults.model.primary' or per-agent in the agent's config.

What is the difference between openclaw agents add and openclaw create agent?

'openclaw agents add' is the official CLI command to add a new agent to your workspace. Some users search for 'openclaw create agent' which refers to the same process. The agents add command scaffolds the agent directory, creates the SOUL.md file, and registers the agent. You can also manually create an agent by making a directory with a SOUL.md file inside your agents folder.

How do I configure authentication for a new agent?

After adding an agent, configure its model provider authentication with 'openclaw models auth paste-token --provider anthropic' (or openai, google, ollama). This stores your API key in the auth-profiles.json file. Each agent inherits the workspace-level auth by default, but you can override it per-agent if needed. Ollama agents don't require API keys since they run locally.

Can I add agents from templates or do I have to write SOUL.md from scratch?

You can do both. OpenClaw's agents add command creates a basic SOUL.md that you customize. For pre-built templates, tools like CrewClaw offer a visual generator with role-specific SOUL.md templates for content writers, SEO analysts, project managers, data analysts, and more. You can generate a complete agent configuration in minutes and download the ready-to-deploy package.

Build your agent visually with CrewClaw

Skip the CLI. Pick a role, configure tools, download a ready-to-deploy agent package. $9 one-time.