agent-smith

agent-smith is a skill for Claude Code, Codex from cyijun/agent-smith. It costs 33 tokens per session (2,784 once invoked), scanned A, original, MIT.

A framework for splitting complex work among multiple AI agents that can run in parallel. Each agent works in its own folder and sends tasks and results through shared message folders.

In plain words
What is it for?
Use it to create coordinated multi-agent systems, divide independent work, run agents simultaneously, and combine their results.
Why use it?
It reduces clashes when several agents edit or process work at the same time. It also provides a structure for breaking large tasks into smaller tasks, including further subtasks.

Skill for Claude CodeCodex

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 skills/cyijun/agent-smith/agent-smith
Any agent
npx skills add cyijun/agent-smith --skill agent-smith
Clone the repo
git clone --depth 1 https://github.com/cyijun/agent-smith

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-smith

README.md
[![agentmods](https://agentmods.dev/badge/skills/cyijun/agent-smith/agent-smith.svg)](https://agentmods.dev/skills/cyijun/agent-smith/agent-smith)
Your own site
<a href="https://agentmods.dev/skills/cyijun/agent-smith/agent-smith"><img src="https://agentmods.dev/badge/skills/cyijun/agent-smith/agent-smith.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,784 The whole file, excluding the scripts and references it only reads on demand.
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.00033 $0.02784
Opus 5 $0.00016 $0.01392
Sonnet 5 $0.00007 $0.00557
Haiku 4.5 $0.00003 $0.00278

Measured 3d ago against content hash 5ad6784c3a3b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-smith 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 3d ago.

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.

agent-smith/SKILL.md · 263 lines

How it starts

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

Agent Smith

实现递归自相似多智能体系统的 Skill。每个智能体(史密斯)拥有独立的工作空间,通过目录隔离协议达成无冲突的并行任务分解与执行。

Overview

Agent Smith 是一个递归自相似的多智能体协作框架。每个智能体(史密斯)遵循相同的协议,在自己的工作空间内独立运行,通过父子间的 inbox/outbox 通信完成复杂任务的分解与汇总。

When to Use

在以下场景触发本 Skill:

  • 用户请求"创建多智能体系统"或"设置 Agent Smith"
  • 任务需要分解为多个并行子任务
  • 需要协调多个 Agent 同时工作
  • 复杂任务需要递归分解处理
  • 要求无冲突的并行执行环境

When NOT to Use

在以下场景请勿触发本 Skill:

  • 单个 Agent 可在 15 分钟内独立完成的任务
  • 子任务之间存在严格线性依赖(每一步必须等待上一步完成)
  • 仅需单 Agent 即可完成,并行执行无收益
  • 任务已充分细化,无需进一步分解

Hard Constraints (Quick Reference)

以下限制由史密斯协议强制执行。修改这些值需要同时更新 SKILL.mdsmith.md

限制
最大递归深度 3(Level 0 根节点 → 最大 Level 3)
每层最大子代理数 5
Level ≥ 3 行为 禁止分解,必须直接执行

核心概念

史密斯 (Smith) 是自相似的智能体单元,每个史密斯拥有唯一 ID 和层级,能够执行任务、分解任务、创建子史密斯并汇总结果。所有史密斯遵循相同的协议,形成递归结构。

所有史密斯均受上述 Hard Constraints 约束。

无冲突协议 通过严格的目录隔离实现并行安全:每个史密斯只能写入自己的 private/outbox/,只能读取自己 inbox/ 中父史密斯分配的任务。父史密斯拥有创建子目录和写入子史密斯 inbox 的专属权限。

目录结构

.agent-smith/
├── smiths/
│   ├── smith-root/             # 根史密斯
│   │   ├── smith.md            # 史密斯定义(只读)
│   │   ├── inbox/              # 任务队列(外部/父写入,自己读取)
│   │   ├── private/            # 私有工作区
│   │   ├── outbox/             # 结果输出
│   │   │   └── result.md
│   │   └── children/           # 子史密斯目录
│   │       └── smith-001/
│   │           ├── smith.md
│   │           ├── inbox/      # 父写入,子读取
│   │           ├── private/
│   │           ├── outbox/
│   │           └── children/
└── results/
    └── final.md                # 最终结果

初始化矩阵

当用户请求初始化 Agent Smith 时,执行以下步骤:

1. 创建目录结构

创建根史密斯环境:

  • .agent-smith/smiths/smith-root/inbox/ —— 任务队列
  • .agent-smith/smiths/smith-root/private/ —— 私有工作区
  • .agent-smith/smiths/smith-root/outbox/ —— 结果输出
  • .agent-smith/smiths/smith-root/children/ —— 子史密斯容器
  • .agent-smith/results/ —— 最终结果

2. 读取 smith.md 模板

smith.md 读取史密斯定义模板。

3. 替换占位符

替换模板中的变量:

  • {SMITH_ID}smith-root
  • {PARENT_ID}none
  • {LEVEL}0

4. 写入根史密斯定义

Read the full file on GitHub · 263 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 263 lines · 33 tokens per session scan A 5ad6784c3a3b

Subscribe to this mod's changes

agent-smith is a skill published in the GitHub repository cyijun/agent-smith (25 stars, last pushed 4mo ago), licensed MIT. It adds 33 tokens to every session and 2,784 once invoked, about $0.0002 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-30.