<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Subagent on KnightLi Blog</title>
        <link>https://knightli.com/en/tags/subagent/</link>
        <description>Recent content in Subagent on KnightLi Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Fri, 08 May 2026 14:14:01 +0800</lastBuildDate><atom:link href="https://knightli.com/en/tags/subagent/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Codex vs Claude Code: How to Choose Between Two Subagent Designs</title>
        <link>https://knightli.com/en/2026/05/08/codex-vs-claude-code-subagent-design/</link>
        <pubDate>Fri, 08 May 2026 14:14:01 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/05/08/codex-vs-claude-code-subagent-design/</guid>
        <description>&lt;p&gt;AI coding tools are paying more attention to subagents. This is not just feature chasing. A single agent eventually hits limits when it has to handle real engineering work.&lt;/p&gt;
&lt;p&gt;If one agent reads code, checks logs, edits implementation, runs tests, analyzes failures, and summarizes results at the same time, the main context quickly becomes noisy. Search results, command output, test logs, and intermediate reasoning get mixed together. Later decisions become less reliable. Work also becomes hard to parallelize: exploration, implementation, verification, and review all sit on one main thread.&lt;/p&gt;
&lt;p&gt;The purpose of subagents is to reduce that pressure. The main session stops doing everything from start to finish and becomes more like a coordinator: define goals, assign work, receive results, and merge them into the final answer. A subagent handles a local piece of work, such as exploration, implementation, verification, or review, and returns a compressed conclusion.&lt;/p&gt;
&lt;p&gt;So a subagent is not “another copy of me.” It is a way to split tangled engineering work into clearer roles.&lt;/p&gt;
&lt;h2 id=&#34;shared-foundations&#34;&gt;Shared Foundations
&lt;/h2&gt;&lt;p&gt;A mature subagent system usually needs four foundations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Context isolation.&lt;/li&gt;
&lt;li&gt;Role specialization.&lt;/li&gt;
&lt;li&gt;Project and user-level configuration.&lt;/li&gt;
&lt;li&gt;Tool and permission boundaries.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Context isolation comes first. Real repositories produce a lot of intermediate material: dozens of search hits, hundreds of test log lines, noisy command output. If all of that is poured into the main session, the main thread gets confused. A subagent can digest that local process and bring back only the signals that matter.&lt;/p&gt;
&lt;p&gt;Role specialization is just as important. Multi-agent does not mean opening several identical models. Exploration roles should search, read, and summarize. Implementation roles should focus on local code changes. Verification roles should run checks, identify risks, and report clearly.&lt;/p&gt;
&lt;p&gt;Tool and permission boundaries determine whether the system can be used safely. A subagent should not automatically inherit every capability of the main session. A read-only explorer does not need write access. A verifier may not need to change implementation. Background tasks and isolated worktrees need visible boundaries.&lt;/p&gt;
&lt;p&gt;Codex and Claude Code share these concerns, but they take different routes.&lt;/p&gt;
&lt;h2 id=&#34;codex-explicit-delegation&#34;&gt;Codex: Explicit Delegation
&lt;/h2&gt;&lt;p&gt;Codex’s subagent design feels restrained.&lt;/p&gt;
&lt;p&gt;It gives you a controlled, lightweight delegation mechanism around the current main session. When to delegate, who receives the task, and when results are collected are all explicit decisions. The control flow stays in the current task.&lt;/p&gt;
&lt;p&gt;Its traits are clear:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The main session explicitly delegates subwork.&lt;/li&gt;
&lt;li&gt;The role set stays small.&lt;/li&gt;
&lt;li&gt;The main session knows which agent is doing what.&lt;/li&gt;
&lt;li&gt;Results return to the main line for final judgment.&lt;/li&gt;
&lt;li&gt;Collaboration boundaries are transparent.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This works well for teams that care about manual orchestration, predictability, and execution determinism. You can ask an explorer to inspect a call chain, ask a worker to make a bounded change, then let the main session merge the result and decide whether to test further.&lt;/p&gt;
&lt;p&gt;The tradeoff is that orchestration pressure still sits with the main session. The main thread must decide when to split work, how to split it, who should take it, and how to merge the result. For lightweight collaboration this is pleasant; for long-running engineering workflows it can become tiring.&lt;/p&gt;
&lt;h2 id=&#34;claude-code-agents-as-workstations&#34;&gt;Claude Code: Agents as Workstations
&lt;/h2&gt;&lt;p&gt;Claude Code takes a more platform-like route.&lt;/p&gt;
&lt;p&gt;It treats agents as describable, selectable, configurable, memorable, isolated, and background-capable objects. A subagent is not just a helper in a conversation. It is closer to a workstation in an engineering system.&lt;/p&gt;
&lt;p&gt;The system can expose agent lists, use cases, descriptions, and tool boundaries to the model, allowing the model to decide which role should handle a turn. That makes delegation more automatic.&lt;/p&gt;
&lt;p&gt;Several capabilities define this direction.&lt;/p&gt;
&lt;p&gt;First, a role system. Explorer, planner, general-purpose, and verifier roles can carry usage descriptions, tool restrictions, default models, and runtime conditions. A read-only explorer can be prevented from editing files. A planner can focus on architecture. A verifier can focus on checks.&lt;/p&gt;
&lt;p&gt;Second, inheritance and overrides. A subagent is not completely free. It inherits the larger boundary of the main session by default, but can adjust local behavior within allowed rules. The main session defines the big boundary; the agent performs local assembly inside it.&lt;/p&gt;
&lt;p&gt;Third, memory. Memory is not just “remember a few things.” It can have scope. User memory is like long-term preference. Project memory is repository background. Local memory is environment-specific state. This lets some agents avoid relearning the project from scratch.&lt;/p&gt;
&lt;p&gt;Fourth, background work and worktree isolation. Some verification tasks can keep running in the background, while the main thread continues. When stronger isolation is needed, an agent can work in a separate worktree, keeping the project connected but the operation space separated.&lt;/p&gt;
&lt;p&gt;Fifth, plugin ecosystem. If agents are first-class objects, you have to think about distribution, installation, priority, override rules, and safety. Plugin agents can enter the system, but high-risk fields such as permission mode, hooks, and MCP servers should remain guarded.&lt;/p&gt;
&lt;p&gt;This makes Claude Code feel more like an agent runtime than a one-session collaboration tool.&lt;/p&gt;
&lt;h2 id=&#34;the-difference&#34;&gt;The Difference
&lt;/h2&gt;&lt;p&gt;Codex is closer to a controlled delegation tool:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Explicit delegation.&lt;/li&gt;
&lt;li&gt;Lightweight role set.&lt;/li&gt;
&lt;li&gt;Clean control flow.&lt;/li&gt;
&lt;li&gt;Subtasks centered on the current session.&lt;/li&gt;
&lt;li&gt;Good for deterministic, human-orchestrated work.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Claude Code is closer to an engineering workstation system:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Agents are formally modeled.&lt;/li&gt;
&lt;li&gt;Roles are more systematic.&lt;/li&gt;
&lt;li&gt;Memory, background execution, isolation, and plugins are part of the runtime.&lt;/li&gt;
&lt;li&gt;The model can help choose roles.&lt;/li&gt;
&lt;li&gt;Good for long-term projects and platform-like workflows.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The real question is not which one has more features. It is whether you want a subagent to be “a helper I explicitly call” or “a long-lived workstation in the system.”&lt;/p&gt;
&lt;h2 id=&#34;how-to-choose&#34;&gt;How to Choose
&lt;/h2&gt;&lt;p&gt;Choose the Codex style if you value explicit control, lightweight delegation, and safe parallelism inside the current session. It is good for code review, small changes, clearly scoped implementation tasks, and workflows where a human wants to keep the rhythm.&lt;/p&gt;
&lt;p&gt;Choose the Claude Code style if you want systematic roles, long-term memory, background execution, worktree isolation, plugin extension, and a more complete agent runtime.&lt;/p&gt;
&lt;p&gt;Ask two questions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Are you comfortable with the model choosing who should do the work?&lt;/li&gt;
&lt;li&gt;Do you need a fuller agent runtime?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If the first question makes you uncomfortable, explicit delegation is likely better. If the second answer is yes, a platform-like workstation system may fit better.&lt;/p&gt;
&lt;h2 id=&#34;practical-advice&#34;&gt;Practical Advice
&lt;/h2&gt;&lt;p&gt;Do not treat subagents as “more models means stronger.” Better practice is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Give every role a clear task boundary.&lt;/li&gt;
&lt;li&gt;Limit the tools each role can use.&lt;/li&gt;
&lt;li&gt;Ask subagents to return conclusions, not raw logs.&lt;/li&gt;
&lt;li&gt;Keep final decisions in the main session.&lt;/li&gt;
&lt;li&gt;Make background tasks and worktree isolation visible.&lt;/li&gt;
&lt;li&gt;Set clear safety boundaries for plugin agents.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The value of subagents is not quantity. It is clean division of labor, cleaner context, and more stable main-thread decisions.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;p&gt;Codex and Claude Code solve the same problem: one agent cannot comfortably carry all real engineering work. Both recognize the importance of context isolation, role specialization, permissions, and local summarization.&lt;/p&gt;
&lt;p&gt;Codex is more restrained, emphasizing explicit delegation and main-session control. Claude Code is more systematic, treating agents as configurable, memorable, isolated, background-capable workstations that can also enter a plugin ecosystem.&lt;/p&gt;
&lt;p&gt;The choice is not which brand wins. It is whether your workflow needs a controlled collaboration tool or a full agent runtime.&lt;/p&gt;
</description>
        </item>
        <item>
        <title>Claude Code Multi-Agent Collaboration: How to Choose Between Subagents and Agent Teams</title>
        <link>https://knightli.com/en/2026/04/22/claude-code-subagents-vs-agent-teams/</link>
        <pubDate>Wed, 22 Apr 2026 21:35:52 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/04/22/claude-code-subagents-vs-agent-teams/</guid>
        <description>&lt;p&gt;When people talk about multi-agent collaboration in Claude Code, the easiest two concepts to mix up are &lt;code&gt;Subagents&lt;/code&gt; and &lt;code&gt;Agent Teams&lt;/code&gt;. They both sound like “spin up several agents to work together,” but they are meant for different kinds of work. In short, the former is better for splitting off independent tasks, while the latter is better when several agents need to collaborate around the same problem and cross-check each other over time.&lt;/p&gt;
&lt;p&gt;If you have used Skills before, this framing also helps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Skill defines the workflow and rules&lt;/li&gt;
&lt;li&gt;A Subagent or Agent teammate does the actual execution&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So the real question is not which one is “more advanced,” but what kind of collaboration problem you are solving.&lt;/p&gt;
&lt;h2 id=&#34;subagents-split-off-side-tasks&#34;&gt;Subagents: split off side tasks
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;Subagents&lt;/code&gt; are closer to temporary worker copies launched from the current session. Each one gets its own context window, and when it finishes, it returns only a summary of the result. The main conversation stays cleaner because it does not have to absorb all the intermediate logs and output.&lt;/p&gt;
&lt;p&gt;That gives Subagents a few very practical strengths:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The main thread stays clean instead of being flooded by test logs, search results, or long output&lt;/li&gt;
&lt;li&gt;Independent research or execution tasks can run in parallel&lt;/li&gt;
&lt;li&gt;They work well for tasks where “just bring me the result” is enough&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The original article notes that Claude Code comes with three built-in kinds of Subagents:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Explore&lt;/code&gt;: read-only, useful for quickly searching a codebase&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Plan&lt;/code&gt;: read-only, useful for gathering information in the background during plan mode&lt;/li&gt;
&lt;li&gt;&lt;code&gt;General-purpose&lt;/code&gt;: can read and write, suitable for tasks that mix exploration and editing&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;custom-subagents&#34;&gt;Custom Subagents
&lt;/h3&gt;&lt;p&gt;If the built-in options are not enough, you can define your own Subagent. The mechanism is simple: write a Markdown file in one of these locations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.claude/agents/&lt;/code&gt;: only active in the current project&lt;/li&gt;
&lt;li&gt;&lt;code&gt;~/.claude/agents/&lt;/code&gt;: active across all your projects&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The file format looks like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;19
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;20
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;21
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;22
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;23
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;24
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;25
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;26
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;27
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;28
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;29
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;30
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;31
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-markdown&#34; data-lang=&#34;markdown&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;name: code-reviewer
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;tools: Read, Grep, Glob, Bash
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;model: inherit
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;You are a senior code reviewer ensuring high standards of code quality and security.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;When invoked:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;1.&lt;/span&gt; Run git diff to see recent changes
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;2.&lt;/span&gt; Focus on modified files
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;3.&lt;/span&gt; Begin review immediately
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Review checklist:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; Code is clear and readable
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; Functions and variables are well-named
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; No duplicated code
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; Proper error handling
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; No exposed secrets or API keys
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; Input validation implemented
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; Good test coverage
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; Performance considerations addressed
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Provide feedback organized by priority:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; Critical issues (must fix)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; Warnings (should fix)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; Suggestions (consider improving)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Include specific examples of how to fix issues.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The key field here is &lt;code&gt;description&lt;/code&gt;. Claude uses it to decide when this Subagent should be called, so the more precise the description is, the more reliable the trigger tends to be.&lt;/p&gt;
&lt;p&gt;A few other common configuration fields are also worth knowing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;tools&lt;/code&gt;: limits which tools the Subagent can use&lt;/li&gt;
&lt;li&gt;&lt;code&gt;model&lt;/code&gt;: chooses between &lt;code&gt;sonnet&lt;/code&gt;, &lt;code&gt;opus&lt;/code&gt;, &lt;code&gt;haiku&lt;/code&gt;, or &lt;code&gt;inherit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;permissionMode&lt;/code&gt;: controls edit permissions and permission prompt behavior&lt;/li&gt;
&lt;li&gt;&lt;code&gt;memory&lt;/code&gt;: gives the Subagent a cross-conversation memory directory&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you only need a Subagent temporarily, you can also define it through the CLI:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;8
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;claude --agents &lt;span class=&#34;s1&#34;&gt;&amp;#39;{
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;  &amp;#34;code-reviewer&amp;#34;: {
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;    &amp;#34;description&amp;#34;: &amp;#34;Expert code reviewer. Use proactively after code changes.&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;    &amp;#34;prompt&amp;#34;: &amp;#34;You are a senior code reviewer. Focus on code quality, security, and best practices.&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;    &amp;#34;tools&amp;#34;: [&amp;#34;Read&amp;#34;, &amp;#34;Grep&amp;#34;, &amp;#34;Glob&amp;#34;, &amp;#34;Bash&amp;#34;],
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;    &amp;#34;model&amp;#34;: &amp;#34;sonnet&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;  }
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id=&#34;when-subagents-fit-best&#34;&gt;When Subagents fit best
&lt;/h3&gt;&lt;p&gt;&lt;code&gt;Subagents&lt;/code&gt; are usually the best fit for tasks like these:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Running tests and returning only the failure summary instead of flooding the main thread with thousands of log lines&lt;/li&gt;
&lt;li&gt;Investigating several unrelated modules in parallel&lt;/li&gt;
&lt;li&gt;Splitting “find the issue” and “fix the issue” into a simple pipeline&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-md&#34; data-lang=&#34;md&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Research the authentication, database, and API modules in parallel using separate subagents
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-md&#34; data-lang=&#34;md&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Use the code-reviewer subagent to find performance issues, then use the optimizer subagent to fix them
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;But if a task needs constant back-and-forth adjustments, shares a lot of context across stages, or concentrates changes in only one or two files, handling it directly in the main conversation is often simpler than spinning up a Subagent.&lt;/p&gt;
&lt;h2 id=&#34;agent-teams-multiple-independent-sessions-working-together&#34;&gt;Agent Teams: multiple independent sessions working together
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;Agent Teams&lt;/code&gt; operate at a different level. Instead of launching worker copies inside one session, they start multiple fully independent Claude Code instances that collaborate around a shared task list and can also message one another directly.&lt;/p&gt;
&lt;p&gt;That makes an Agent Team feel more like a real small team than a simple side-task worker setup.&lt;/p&gt;
&lt;p&gt;The article notes that this is currently an experimental feature and needs to be enabled first:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nt&#34;&gt;&amp;#34;env&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nt&#34;&gt;&amp;#34;CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;1&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Once this is added to &lt;code&gt;settings.json&lt;/code&gt;, you can ask Claude to organize a team around a specific goal. For example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-md&#34; data-lang=&#34;md&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;I&amp;#39;m designing a CLI tool that helps developers track TODO comments across
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;their codebase. Create an agent team to explore this from different angles: one
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;teammate on UX, one on technical architecture, one playing devil&amp;#39;s advocate.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id=&#34;what-an-agent-team-consists-of&#34;&gt;What an Agent Team consists of
&lt;/h3&gt;&lt;p&gt;An Agent Team mainly includes three parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Team lead: the main session you are using, responsible for organizing, assigning, and summarizing&lt;/li&gt;
&lt;li&gt;Teammates: multiple independent Claude Code instances&lt;/li&gt;
&lt;li&gt;Task list and Mailbox: the shared task list and communication channel&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The biggest difference from &lt;code&gt;Subagents&lt;/code&gt; is that teammates can communicate directly with one another instead of routing everything through the lead. Tasks usually move through states such as &lt;code&gt;pending&lt;/code&gt;, &lt;code&gt;in progress&lt;/code&gt;, and &lt;code&gt;completed&lt;/code&gt;, and once a teammate finishes one task, it can pick up the next one.&lt;/p&gt;
&lt;h3 id=&#34;when-agent-teams-fit-best&#34;&gt;When Agent Teams fit best
&lt;/h3&gt;&lt;p&gt;When a task needs several perspectives, active discussion, conflicting hypotheses, or parallel work across modules, &lt;code&gt;Agent Teams&lt;/code&gt; are a better fit.&lt;/p&gt;
&lt;p&gt;The article gives several representative examples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Several reviewers inspect the same PR in parallel, each focusing on a different dimension&lt;/li&gt;
&lt;li&gt;Multiple agents investigate the same bug with competing explanations and challenge each other’s conclusions&lt;/li&gt;
&lt;li&gt;Frontend, backend, and testing move forward in parallel on different parts of the project&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, parallel code review:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-md&#34; data-lang=&#34;md&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Create an agent team to review PR &lt;span class=&#34;ni&#34;&gt;#142&lt;/span&gt;. Spawn three reviewers:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; One focused on security implications
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; One checking performance impact
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;-&lt;/span&gt; One validating test coverage
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Have them each review and report findings.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;And for debate-style debugging:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-md&#34; data-lang=&#34;md&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Users report the app exits after one message instead of staying connected.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Spawn 5 agent teammates to investigate different hypotheses. Have them talk to
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;each other to try to disprove each other&amp;#39;s theories, like a scientific
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;debate. Update the findings doc with whatever consensus emerges.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The common pattern here is that you do not just want one answer. You want several agents to exchange judgments, challenge assumptions, and gradually converge on a stronger conclusion.&lt;/p&gt;
&lt;h2 id=&#34;how-to-choose-between-them&#34;&gt;How to choose between them
&lt;/h2&gt;&lt;p&gt;If you want a quick rule of thumb, use this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you just need the result, use &lt;code&gt;Subagents&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If the work requires discussion and cross-validation, use &lt;code&gt;Agent Teams&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Expanded a bit further, the main differences are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Communication style: &lt;code&gt;Subagents&lt;/code&gt; mainly report results back to the main session, while &lt;code&gt;Agent Teams&lt;/code&gt; members can talk directly to one another&lt;/li&gt;
&lt;li&gt;Coordination model: &lt;code&gt;Subagents&lt;/code&gt; depend more on the main conversation to orchestrate them, while &lt;code&gt;Agent Teams&lt;/code&gt; work from a shared task list that members can claim themselves&lt;/li&gt;
&lt;li&gt;Token cost: &lt;code&gt;Subagents&lt;/code&gt; are cheaper, while &lt;code&gt;Agent Teams&lt;/code&gt; cost more because each teammate is an independent instance&lt;/li&gt;
&lt;li&gt;Best-fit tasks: &lt;code&gt;Subagents&lt;/code&gt; are better for independent, result-oriented work, while &lt;code&gt;Agent Teams&lt;/code&gt; are better for discussion-heavy and cross-check-heavy work&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;practical-cautions&#34;&gt;Practical cautions
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;Agent Teams&lt;/code&gt; are more powerful, but that does not mean every task deserves a full team. The article specifically calls out a few practical concerns:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;token usage is noticeably higher&lt;/li&gt;
&lt;li&gt;if multiple teammates edit the same file at once, overwrite conflicts become very likely&lt;/li&gt;
&lt;li&gt;adding too many teammates increases coordination cost without guaranteeing better results&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A safer default is usually:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;start with 3 to 5 teammates&lt;/li&gt;
&lt;li&gt;split tasks by module or file to avoid edit conflicts&lt;/li&gt;
&lt;li&gt;if the lead starts doing teammate work too early, explicitly tell it to wait for the others first&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The current experimental version also has a few limitations, such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;no support for &lt;code&gt;/resume&lt;/code&gt; and &lt;code&gt;/rewind&lt;/code&gt; for in-process teammates&lt;/li&gt;
&lt;li&gt;task status can lag and sometimes needs manual correction&lt;/li&gt;
&lt;li&gt;one lead can manage only one team at a time&lt;/li&gt;
&lt;li&gt;teammates cannot spawn child teams of their own&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;short-conclusion&#34;&gt;Short conclusion
&lt;/h2&gt;&lt;p&gt;These two features are not substitutes for one another. They solve two different collaboration problems.&lt;/p&gt;
&lt;p&gt;If your goal is “parallelize side tasks and keep the main context clean,” start with &lt;code&gt;Subagents&lt;/code&gt;. If your goal is “let several agents work like a small team, discuss, and cross-check each other,” then &lt;code&gt;Agent Teams&lt;/code&gt; are the better tool.&lt;/p&gt;
&lt;p&gt;Trying both in a real task usually makes the distinction obvious very quickly: one is optimized for context isolation and result collection, and the other is optimized for multi-perspective collaboration and ongoing interaction.&lt;/p&gt;
&lt;h2 id=&#34;related-links&#34;&gt;Related links
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Original article: &lt;a class=&#34;link&#34; href=&#34;https://cloud.tencent.com/developer/article/2652960&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://cloud.tencent.com/developer/article/2652960&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        
    </channel>
</rss>
