multi-agent

Guidance for building systems where several OpenClaw agents work together. It describes separate agent files, shared-file communication, and common team patterns such as reporting, scouting, and monitoring.

In plain words
What is it for?
Use it to design multi-agent workflows, assign roles, share results through files or users, and chain scheduled tasks.
Why use it?
It clarifies how agents can coordinate when they do not share memory or sessions. This helps avoid assuming that one agent can directly access another's state.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/mergisi/openclaw-rules/multi-agent
Clone the repo
git clone --depth 1 https://github.com/mergisi/openclaw-rules
Per session 534 This file is loaded in full into every session.
When invoked 534 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00534 $0.00534
Opus 5 $0.00267 $0.00267
Sonnet 5 $0.00107 $0.00107
Haiku 4.5 $0.00053 $0.00053

Measured yesterday against content hash 727c5bc53b12, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

multi-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

project-rules/multi-agent.mdc · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Multi-Agent Teams

When building systems with multiple OpenClaw agents working together.

Architecture

Each agent runs independently with its own:

  • SOUL.md (identity)
  • config.json (metadata)
  • MEMORY.md (persistent state)
  • Tool scripts

Agents do NOT share memory or sessions. They communicate through:

  1. The user (human-in-the-loop)
  2. Shared files on disk
  3. Scheduled tasks that chain outputs

Common Team Patterns

The Reporter Team

Metrics Agent  →  collects data daily
Writer Agent   →  turns data into reports
User           →  reviews and distributes

The Scout-Writer Pattern

Scout Agent    →  finds opportunities (Reddit, HN, Twitter)
Writer Agent   →  drafts replies/posts
User           →  approves and posts

The Monitor-Alert Pattern

Monitor Agent  →  watches systems 24/7
Alert Agent    →  formats and sends notifications
User           →  investigates and resolves

Setting Up a Team

agents/
├── orion/          # PM Agent
│   ├── SOUL.md
│   ├── config.json
│   └── MEMORY.md
├── echo/           # Writer Agent
│   ├── SOUL.md
│   ├── config.json
│   └── MEMORY.md
└── radar/          # SEO Agent
    ├── SOUL.md
    ├── config.json
    └── MEMORY.md

Each agent needs a unique sessionKey in config.json:

{ "sessionKey": "agent:orion:main" }
{ "sessionKey": "agent:echo:main" }
{ "sessionKey": "agent:radar:main" }

Best Practices

  • Keep agents focused. One agent, one role. Don't make a "do everything" agent.
  • 3-5 agents is the sweet spot. More than 5 becomes hard to manage.
  • Human-in-the-loop for actions. Agents research and draft. Humans approve and execute. This prevents mistakes and builds trust.
  • Shared tool scripts are OK. Multiple agents can use the same ga4-report.cjs. But each agent should have its own SOUL.md and config.
  • Use MEMORY.md for coordination. If Agent A needs to pass info to Agent B, write it to a shared file. The user can then tell Agent B to read it.

Read the full file on GitHub · 74 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 74 lines · 534 tokens per session scan A 727c5bc53b12

Subscribe to this mod's changes

multi-agent is a cursor rule published in the GitHub repository mergisi/openclaw-rules (2 stars, last pushed 6mo ago), licensed MIT. It adds 534 tokens to every session, about $0.0027 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.