Week 10 of 12 🤖
Subagents และการมอบหมายงาน
Subagents 与任务分派
Click a card to flip it. คลิกการ์ดเพื่อพลิก 点击卡片翻面。
Which agent type is read-only?
Agent ประเภทใดเป็นแบบอ่านอย่างเดียว?
哪种 agent 类型是只读的?
Which is passive voice?
ข้อใดเป็น passive voice?
哪个句子是被动语态?
Where are custom agents defined?
Custom agents ถูกกำหนดที่ไหน?
自定义 agents 在哪里定义?
How to do it
How to do it
.claude/agents/reviewer.md.name, description, and optional tool limits.How to do it
background: true in the agent's frontmatter, or press Ctrl+B while one runs.How to do it
tools: Read, Grep = allowlist — the agent can use only these.disallowedTools: = denylist — everything except these.How to do it
/agents to see every configured agent.An agent file is four frontmatter fields plus a job description. Each field has a job:
| Field | What it does |
|---|---|
name | the agent's id — how you and Claude refer to it |
description | when Claude should pick this agent by itself. Write it like advice to a dispatcher: "Use for code review after changes." |
tools | comma-separated allowlist (Read, Grep). Leave it out
and the agent gets every tool — leash it on purpose. |
model | optional: run this agent on a cheaper/faster model
(haiku) or a stronger one (opus) |
What actually happens when you say "use the reviewer agent":
description and picks the match
(or obeys you naming one directly).Edit can read every file and change none — the leash is the safety.Two habits that make agents work well: keep the body instructions specific and short (a job description, not an essay), and test a new agent by invoking it by name first — automatic dispatch only works once the description is sharp.
Step by step
.claude/agents/reviewer.md with frontmatter tools: Read, Grep./agents and check the reviewer is listed.✓ You did it right if: you get a list of findings and not a single file was changed.
# Save as: .claude/agents/reviewer.md # (tools list is comma separated - only these two are allowed) --- name: reviewer description: Reviews code for bugs and unclear names. Use for code review. tools: Read, Grep --- You are a careful code reviewer. - Report bugs, unclear names and missing error handling. - Suggest fixes, but NEVER edit files yourself. - End with one line: "N issues found." # ---- Use it ---- > Use the reviewer agent to review app.py * reviewer: 3 issues found - unused import (line 2), no error handling in load_data(), unclear name "x". (no files changed - the agent has no Edit tool)
| Command / Tool | English | ภาษาไทย | 中文 |
|---|---|---|---|
Explore | Fast read-only search (Haiku) | ค้นหาเร็วแบบอ่านอย่างเดียว | 快速只读搜索 |
Plan | Architecture research | วิจัยสถาปัตยกรรม | 架构研究 |
general-purpose | Full tools, complex tasks | เครื่องมือครบ งานซับซ้อน | 全套工具,复杂任务 |
.claude/agents/ | Custom agent directory | ไดเรกทอรี agent ที่กำหนดเอง | 自定义 agent 目录 |
/agents | Manage agents | จัดการ agents | 管理 agents |
Race sequential against parallel, and put a reviewer agent on a tool leash. / แข่งแบบเรียงกับแบบขนาน และจำกัดเครื่องมือ agent / 顺序 vs 并行赛跑,并给 agent 限制工具
Four research tasks. Run them one-by-one, then all at once.