0dai swarm vs Claude Code subagents
Claude Code (CLI v2.1.139, May 2026) ships first-party subagents: Markdown files with YAML frontmatter, scoped tool access, per-agent model overrides, optional git-worktree isolation, and an in-process Agent tool that the main session uses to dispatch them.
0dai swarm is a file-queue task system: agents (any CLI — Codex, Claude Code, OpenCode, Aider, Qoder, Gemini) read and write JSON tasks in ai/swarm/queue/. There is no broker and no process supervisor — only files in the repo and the agent CLIs you already run.
Both solve overlapping problems with different premises. This page is the honest read on where each one fits.
TL;DR
- Use Claude Code subagents when your team is all on Claude Code, you want zero-setup delegation inside one session, and per-agent tool restrictions are worth the lock-in.
- Use 0dai swarmwhen agents from different CLIs must cooperate on the same repo, when you need the task queue and persona definitions in git alongside the code they touch, or when the operator wants an inspectable audit trail outside any single vendor's session.
- The two compose. A Claude Code subagent can produce a 0dai swarm task for a Codex worker to pick up. The import adapter (below) covers the static configuration half of the round trip.
Feature matrix
| Capability | Claude Code subagents | 0dai swarm |
|---|---|---|
| Definition format | Markdown + YAML frontmatter | YAML persona files + JSON task records |
| Storage location | .claude/agents/, ~/.claude/agents/, managed settings, plugins, --agents JSON | templates/layer/ai/personas/*.yaml, ai/swarm/queue/*.json |
| Required CLI | Claude Code | None — any CLI that can read and write JSON files |
| Cross-CLI portability | None — runs only inside Claude Code | Codex, Claude Code, OpenCode, Aider, Qoder, Gemini, shell |
| Per-agent model override | model: sonnet | opus | haiku | <id> | inherit | Persona declares preferred CLI; model picked by that CLI |
| Tool allowlist / denylist | tools: / disallowedTools: enforced | Not enforced — depends on each CLI's permission settings |
| Permission mode per agent | default | acceptEdits | auto | dontAsk | bypassPermissions | plan | Inherits the picking CLI's permission mode |
| Isolation | isolation: worktree auto-creates a temp worktree | Worktree per task is opt-in via 0dai swarm pick |
| Persistent memory per agent | memory: user | project | local at ~/.claude/agent-memory/ | Personas share ai/memory/; no per-persona dir |
| Concurrency | Capped by the Claude Code session scheduler | Many sessions, many CLIs, many machines — one file per task |
| Nested delegation | Subagents cannot spawn subagents | Any worker can write a new task back to the queue |
| Hooks per agent | hooks: frontmatter | Repo-wide hooks; no per-persona hooks |
| Scoped MCP servers | mcpServers: frontmatter; inline or by reference | All workers inherit the repo's .mcp.json |
| Audit trail | Session transcript only | ai/swarm/log/*.jsonl is git-tracked; activity feed via MCP |
| Operator review gate | Inherits the parent session's review path | Tier-gate / ghost-veto inspects tasks before merge |
| Vendor coupling | Tied to Claude Code release cadence | Tied to 0dai release cadence; CLIs swappable |
Where Claude Code subagents are strictly better
- Tool sandboxing.
tools,disallowedTools, andpermissionModeare enforced by the Claude Code runtime. 0dai swarm has no equivalent. - Setup cost. A Markdown file in
.claude/agents/is one commit and zero new processes. - In-session feedback. A subagent returns its summary into the parent transcript. A swarm worker writes to a queue file and may finish minutes or hours later.
Where 0dai swarm is strictly better
- Cross-CLI work. A Claude Code subagent cannot delegate to Codex. A swarm task can be picked up by Codex, OpenCode, or a human.
- Git-native audit. Every task lifecycle event is a file change.
git log ai/swarm/is the history. - Multi-host fanout. Workers do not need to share one CLI session or one machine.
- Persona inheritance.
templates/layer/ai/personas/*.yamlcarriesreferences,defers_to,escalates_to, and role policy. Claude Code subagent files carry a system prompt; the social structure is implicit.
Honest gaps in 0dai swarm
The matrix marks these — they are not hidden in the body:
- No per-persona tool restriction. If you need a researcher that provably cannot write to disk, use a Claude Code subagent with
tools: Read, Grep, Globand Write denied. 0dai swarm cannot enforce that. - No per-persona memory directory — personas share
ai/memory/. - No in-session summary return — workers return through the queue.
- No first-party UI. Claude Code ships
/agentsandclaude agents. 0dai swarm relies on0dai swarm statusand the dashboard.
Import adapter
Phase 2 of issue 2197 ships 0dai import claude-code-agents. The shape of the conversion is documented below so the contract is reviewable before the code lands. Source files are .claude/agents/*.md (project) or ~/.claude/agents/*.md (user). Targets are ai/personas/<name>.yaml.
| Claude Code frontmatter | 0dai persona YAML | Notes |
|---|---|---|
name | name | Reserved names collide and abort with a diff suggestion. |
description | description | Copied verbatim. |
model | preferred_model | inherit becomes unset. |
tools / disallowedTools | tools.allow / tools.deny | Recorded; not enforced at swarm dispatch. |
permissionMode | permission_mode | Consumed only when the picking CLI is Claude Code. |
mcpServers | mcp_servers | String references resolve against .mcp.json. |
hooks | dropped | 0dai hooks are repo-wide; importer prints a warning. |
memory | memory_scope | local becomes project with a warning. |
| Markdown body | system_prompt_addition | Inlined verbatim. |
Round-trip is preserved by storing the original frontmatter under claude_code: so 0dai sync can regenerate .claude/agents/<name>.md without information loss.
Decision table
| Situation | Recommendation |
|---|---|
| Solo developer, all-Claude-Code workflow | Claude Code subagents |
| Team uses Claude Code and Codex side-by-side | 0dai swarm + persona library |
| Need to provably restrict tools per agent | Claude Code subagents |
| Need an inspectable, git-tracked audit trail | 0dai swarm |
| Tasks span multiple days or hosts | 0dai swarm |
| Tasks return inside one transcript | Claude Code subagents |
| Operator must veto before merge | 0dai swarm (tier-gate / ghost-veto) |
References
- Claude Code subagents: code.claude.com/docs/en/sub-agents
- Claude Code changelog: anthropics/claude-code CHANGELOG.md
- 0dai swarm reference: /docs/swarm
- Source doc in repo:
docs/comparisons/vs-claude-code-subagents.md