> ## Documentation Index
> Fetch the complete documentation index at: https://felimet-hub.jmcores.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 04-11 Agent Teams vs Subagents: Differences, Enablement, Collaboration

> Subagents are one-shot executors that vanish after returning a result. Agent Teams are addressable, persistent, collaborative agents that keep their identity, can receive messages, and share state. This unit clarifies lifecycle differences, how to enable each, and when three collaboration patterns apply.

export const ToolCompare = ({lang = "zh", tools = [], dimensions = [], defaultSelected, notes = []}) => {
  const UI = lang === "en" ? {
    allTools: "All",
    recommend: "Recommended",
    noSupport: "N/A",
    minOneToolW: "Select at least one tool",
    mobileLabel: "Tool",
    dimensionLbl: "Dimension",
    notes: "Notes"
  } : {
    allTools: "全選",
    recommend: "推薦",
    noSupport: "無對應",
    minOneToolW: "至少選一個工具",
    mobileLabel: "工具",
    dimensionLbl: "維度",
    notes: "注意事項"
  };
  const ACCENT_L = "#bf7551";
  const ACCENT_D = "#cf8a68";
  const REC_BDR_L = "rgba(191,117,81,0.45)";
  const REC_BG_L = "rgba(191,117,81,0.06)";
  const REC_BDR_D = "rgba(207,138,104,0.45)";
  const REC_BG_D = "rgba(207,138,104,0.08)";
  const looksLikePath = val => typeof val === "string" && (/[/\\.*:]/).test(val);
  const safeTools = Array.isArray(tools) ? tools : [];
  const safeDimensions = Array.isArray(dimensions) ? dimensions : [];
  if (safeTools.length === 0 || safeDimensions.length === 0) return null;
  const allIds = safeTools.map(t => t.id);
  const initSelected = Array.isArray(defaultSelected) && defaultSelected.length > 0 ? defaultSelected.filter(id => allIds.includes(id)) : allIds;
  const [selectedIds, setSelectedIds] = useState(initSelected.length > 0 ? initSelected : allIds);
  const [expandedCell, setExpandedCell] = useState(null);
  const [mobileTool, setMobileTool] = useState(initSelected[0] || allIds[0]);
  const [isDark, setIsDark] = useState(false);
  useEffect(() => {
    const detect = () => setIsDark(document.documentElement.classList.contains("dark"));
    detect();
    const obs = new MutationObserver(detect);
    obs.observe(document.documentElement, {
      attributes: true,
      attributeFilter: ["class"]
    });
    return () => obs.disconnect();
  }, []);
  const toggleTool = id => {
    setSelectedIds(prev => {
      const next = prev.includes(id) ? prev.filter(x => x !== id) : [...prev, id];
      if (next.length === 0) return prev;
      if (expandedCell) {
        const [, cellToolId] = expandedCell.split(":");
        if (!next.includes(cellToolId)) setExpandedCell(null);
      }
      return next;
    });
  };
  const isAllSelected = selectedIds.length === allIds.length;
  const toggleAll = () => {
    if (isAllSelected) {
      setSelectedIds([allIds[0]]);
    } else {
      setSelectedIds(allIds);
    }
    setExpandedCell(null);
  };
  const visibleTools = safeTools.filter(t => selectedIds.includes(t.id));
  const cellKey = (dimId, toolId) => dimId + ":" + toolId;
  const toggleExpand = (dimId, toolId) => {
    const key = cellKey(dimId, toolId);
    setExpandedCell(prev => prev === key ? null : key);
  };
  const renderValue = cell => {
    if (cell.na) {
      return <span className="tc-na">{UI.noSupport}</span>;
    }
    const useMono = cell.mono === true || cell.mono !== false && looksLikePath(cell.value);
    return useMono ? <code className="tc-code">{cell.value}</code> : <span>{cell.value}</span>;
  };
  const css = `
  /* ── 根容器 ── */
  .tc-root {
    --tc-bg:           #FAF8F3;
    --tc-surface:      rgba(0,0,0,0.022);
    --tc-stripe:       rgba(0,0,0,0.028);
    --tc-border:       rgba(0,0,0,0.09);
    --tc-text:         #2b2722;
    --tc-dim:          #6f6a62;
    --tc-faint:        #8a8378;
    --tc-accent:       ${ACCENT_L};
    --tc-accent-bg:    ${REC_BG_L};
    --tc-accent-bdr:   ${REC_BDR_L};
    --tc-expand-bg:    rgba(0,0,0,0.016);
    --tc-code-bg:      rgba(0,0,0,0.055);
    --tc-na-color:     #9a9490;
    --tc-pill-on-bg:   rgba(191,117,81,0.10);
    --tc-pill-on-bdr:  rgba(191,117,81,0.35);
    --tc-pill-on-txt:  #a05c38;
    border: 1px solid var(--tc-border);
    border-radius: 14px;
    background: var(--tc-bg);
    color: var(--tc-text);
    overflow: hidden;
    font-size: 14px;
  }
  .dark .tc-root {
    --tc-bg:           #1b1a18;
    --tc-surface:      rgba(255,255,255,0.03);
    --tc-stripe:       rgba(255,255,255,0.025);
    --tc-border:       rgba(255,255,255,0.08);
    --tc-text:         #e7e3da;
    --tc-dim:          #a8a299;
    --tc-faint:        #706b64;
    --tc-accent:       ${ACCENT_D};
    --tc-accent-bg:    ${REC_BG_D};
    --tc-accent-bdr:   ${REC_BDR_D};
    --tc-expand-bg:    rgba(255,255,255,0.022);
    --tc-code-bg:      rgba(255,255,255,0.08);
    --tc-na-color:     #6e6b65;
    --tc-pill-on-bg:   rgba(207,138,104,0.12);
    --tc-pill-on-bdr:  rgba(207,138,104,0.35);
    --tc-pill-on-txt:  ${ACCENT_D};
  }

  /* ── 精簡篩選列 ── */
  .tc-filter-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 14px;
    border-bottom: 1px solid var(--tc-border);
    background: var(--tc-surface);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* 單行、不折行，高度由內容決定（約 36px） */
    flex-wrap: nowrap;
    white-space: nowrap;
    min-height: 36px;
  }
  .tc-filter-bar::-webkit-scrollbar { display: none; }

  /* 分隔竿（All 後面） */
  .tc-filter-sep {
    flex-shrink: 0;
    width: 1px;
    height: 14px;
    background: var(--tc-border);
    margin: 0 10px 0 6px;
    align-self: center;
  }

  /* pill 基底 — 極輕量文字標籤 */
  .tc-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    border-radius: 5px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--tc-faint);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.12s, background 0.12s, border-color 0.12s;
    flex-shrink: 0;
    white-space: nowrap;
    /* 行高對齊 filter-bar */
    margin: 5px 1px;
  }
  .tc-pill:hover {
    color: var(--tc-text);
    background: rgba(0,0,0,0.04);
  }
  .dark .tc-pill:hover {
    background: rgba(255,255,255,0.05);
  }
  /* 選中態：細框 + 淡底 + 文字加深（非按鈕感，保持輕量） */
  .tc-pill-on {
    color: var(--tc-pill-on-txt);
    background: var(--tc-pill-on-bg);
    border-color: var(--tc-pill-on-bdr);
    font-weight: 600;
  }
  /* 全選 pill — 略小一點字型 */
  .tc-pill-all {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 4px 8px;
    color: var(--tc-dim);
  }
  .tc-pill-all.tc-pill-on {
    color: var(--tc-pill-on-txt);
  }
  /* 選中小圓點 */
  .tc-pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--tc-accent);
    flex-shrink: 0;
  }

  /* ── 桌面表格 ── */
  .tc-table-wrap {
    overflow: hidden;
  }
  /* Mintlify 的 MDX 渲染器會自動把 <table> 包進 data-table-wrapper：
   * 加 -mx-[var(--page-padding)] 負邊距 + w-[calc(100%+padding*2)] 全寬 + py-[1em]，
   * 讓表格往外溢出，撐破 tc-root 的圓角容器（2026-06-12 線上實證跑版）。
   * 中和它：邊距歸零、寬度收回 100%、把橫向捲動容器設在這層（sticky 左欄靠它）。 */
  .tc-root [data-table-wrapper] {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow-x: auto;
    contain: none !important;
  }
  .tc-root [data-table-wrapper] > div {
    padding: 0 !important;
    margin: 0 !important;
  }
  .tc-root [data-table-wrapper]::-webkit-scrollbar { height: 4px; }
  .tc-root [data-table-wrapper]::-webkit-scrollbar-thumb { background: var(--tc-border); border-radius: 2px; }
  .tc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 !important;
  }

  /* 表頭 */
  .tc-thead th {
    padding: 9px 15px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tc-faint);
    border-bottom: 2px solid var(--tc-border);
    background: var(--tc-surface);
    white-space: nowrap;
  }
  /* 維度欄（sticky 左欄） */
  .tc-thead th:first-child,
  .tc-td-dim {
    position: sticky;
    left: 0;
    z-index: 1;
  }
  .tc-thead th:first-child {
    width: 160px;
    min-width: 130px;
    background: var(--tc-surface);
    border-right: 1px solid var(--tc-border);
    z-index: 2;
  }

  /* 維度標籤欄 */
  .tc-td-dim {
    padding: 13px 15px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tc-dim);
    vertical-align: middle;
    white-space: nowrap;
    border-bottom: 1px solid var(--tc-border);
    border-right: 1px solid var(--tc-border);
    background: var(--tc-surface);
  }

  /* 斑馬紋：奇數維度列 */
  .tc-row-even .tc-td-dim,
  .tc-row-even .tc-td {
    background-color: var(--tc-stripe);
  }
  .tc-row-even .tc-td-dim {
    background: color-mix(in srgb, var(--tc-surface) 70%, var(--tc-stripe) 30%);
  }

  /* 資料儲存格 */
  .tc-td {
    padding: 0;
    border-bottom: 1px solid var(--tc-border);
    border-left: 1px solid var(--tc-border);
    vertical-align: top;
    min-width: 150px;
  }
  .tc-td-inner {
    display: flex;
    flex-direction: column;
  }

  /* 主值行（可點擊） */
  .tc-cell-btn {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 13px 15px;
    color: inherit;
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.11s;
    -webkit-tap-highlight-color: transparent;
  }
  .tc-cell-btn:hover {
    background: rgba(0,0,0,0.03);
  }
  .dark .tc-cell-btn:hover {
    background: rgba(255,255,255,0.03);
  }
  .tc-cell-btn-on {
    background: var(--tc-expand-bg);
  }

  /* 推薦標記：左 3px accent 邊框 + 淡底 */
  .tc-td-recommend {
    border-left: 3px solid var(--tc-accent-bdr);
    background: var(--tc-accent-bg);
  }
  .tc-td-recommend .tc-cell-btn:hover {
    background: rgba(191,117,81,0.05);
  }

  /* recommend 角標：超小 badge */
  .tc-rec-badge {
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tc-accent);
    border: 1px solid var(--tc-accent-bdr);
    border-radius: 3px;
    padding: 1px 4px;
    white-space: nowrap;
    opacity: 0.85;
  }

  /* na 樣式 */
  .tc-na {
    font-style: italic;
    color: var(--tc-na-color);
    font-size: 12.5px;
    opacity: 0.7;
  }

  /* 等寬值 */
  .tc-code {
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 12px;
    background: var(--tc-code-bg);
    border-radius: 3px;
    padding: 1px 4px;
    word-break: break-all;
  }

  /* 展開詳情列 */
  .tc-detail-row td {
    padding: 0;
    border-bottom: 1px solid var(--tc-border);
  }
  .tc-detail-cell {
    padding: 10px 15px 12px;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--tc-dim);
    background: var(--tc-expand-bg);
    border-top: 1px dashed var(--tc-border);
    border-left: 1px solid var(--tc-border);
  }
  .tc-detail-cell:first-child {
    border-left: none;
    font-weight: 700;
    color: var(--tc-faint);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: top;
    padding-top: 12px;
    background: var(--tc-surface);
    white-space: nowrap;
    width: 160px;
  }
  .tc-detail-recommend {
    border-left: 3px solid var(--tc-accent-bdr) !important;
    background: var(--tc-accent-bg) !important;
  }

  /* 展開箭頭 */
  .tc-chevron {
    flex-shrink: 0;
    margin-top: 3px;
    opacity: 0.35;
    transition: transform 0.14s, opacity 0.14s;
  }
  .tc-chevron-open {
    transform: rotate(90deg);
    opacity: 0.65;
  }

  /* ── 注腳 ── */
  .tc-notes {
    border-top: 1px solid var(--tc-border);
    padding: 10px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .tc-notes-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--tc-faint);
    margin-bottom: 3px;
  }
  .tc-note-item {
    font-size: 12.5px;
    color: var(--tc-dim);
    line-height: 1.55;
    padding-left: 14px;
    position: relative;
  }
  .tc-note-item::before {
    content: "*";
    position: absolute;
    left: 2px;
    color: var(--tc-faint);
  }

  /* ── 手機模式 ─────────────────────────────────────────── */
  .tc-mobile { display: none; }
  @media (max-width: 700px) {
    .tc-filter-bar { display: none; }
    .tc-table-wrap  { display: none; }
    .tc-mobile      { display: block; }

    .tc-mob-tabs {
      display: flex;
      overflow-x: auto;
      border-bottom: 1px solid var(--tc-border);
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .tc-mob-tabs::-webkit-scrollbar { display: none; }
    .tc-mob-tab {
      flex: 1 0 auto;
      padding: 10px 16px;
      background: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      color: var(--tc-dim);
      font: inherit;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      transition: color 0.12s, border-color 0.12s;
    }
    .tc-mob-tab-on {
      color: var(--tc-accent);
      border-bottom-color: var(--tc-accent);
      font-weight: 700;
    }
    .tc-mob-cards {
      padding: 12px 0 4px;
    }
    .tc-mob-card {
      border-bottom: 1px solid var(--tc-border);
      padding: 12px 16px;
    }
    .tc-mob-card:last-child { border-bottom: none; }
    .tc-mob-dim {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: var(--tc-faint);
      margin-bottom: 6px;
    }
    .tc-mob-val {
      font-size: 13.5px;
      line-height: 1.55;
    }
    .tc-mob-rec {
      display: inline-block;
      margin-top: 6px;
      font-size: 9.5px;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: var(--tc-accent);
      border: 1px solid var(--tc-accent-bdr);
      border-radius: 3px;
      padding: 1px 5px;
    }
    .tc-mob-detail {
      margin-top: 7px;
      font-size: 12.5px;
      line-height: 1.65;
      color: var(--tc-dim);
    }
    .tc-notes { padding: 11px 16px 13px; }
  }
  `;
  const renderDesktopTable = () => <div className="tc-table-wrap">
      <table className="tc-table">
        <thead className="tc-thead">
          <tr>
            <th>{UI.dimensionLbl}</th>
            {visibleTools.map(tool => <th key={tool.id}>{tool.label}</th>)}
          </tr>
        </thead>
        <tbody>
          {}
          {safeDimensions.flatMap((dim, dimIdx) => {
    const isAnyExpanded = visibleTools.some(t => expandedCell === cellKey(dim.id, t.id));
    const stripeClass = dimIdx % 2 === 1 ? " tc-row-even" : "";
    const rows = [];
    rows.push(<tr key={dim.id} className={"tc-row" + stripeClass}>
                <td className="tc-td-dim">{dim.label}</td>
                {visibleTools.map(tool => {
      const cell = (dim.cells || ({}))[tool.id] || ({});
      const key = cellKey(dim.id, tool.id);
      const isOpen = expandedCell === key;
      const hasDetail = !!cell.detail;
      const isRec = !!cell.recommend;
      return <td key={tool.id} className={"tc-td" + (isRec ? " tc-td-recommend" : "")}>
                      <div className="tc-td-inner">
                        <button type="button" className={"tc-cell-btn" + (isOpen ? " tc-cell-btn-on" : "")} onClick={hasDetail ? () => toggleExpand(dim.id, tool.id) : undefined} style={hasDetail ? {} : {
        cursor: "default"
      }} aria-expanded={hasDetail ? String(isOpen) : undefined}>
                          <span style={{
        flex: "1 1 0",
        minWidth: 0
      }}>
                            {renderValue(cell)}
                          </span>
                          {isRec && <span className="tc-rec-badge">{UI.recommend}</span>}
                          {hasDetail && <svg className={"tc-chevron" + (isOpen ? " tc-chevron-open" : "")} width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
                              <polyline points="9 18 15 12 9 6" />
                            </svg>}
                        </button>
                      </div>
                    </td>;
    })}
              </tr>);
    if (isAnyExpanded) {
      const openToolId = visibleTools.find(t => expandedCell === cellKey(dim.id, t.id))?.id;
      const openCell = openToolId ? (dim.cells || ({}))[openToolId] || ({}) : {};
      if (openCell.detail) {
        const openTool = safeTools.find(t => t.id === openToolId);
        const isRec = !!openCell.recommend;
        rows.push(<tr key={dim.id + "-detail"} className="tc-detail-row">
                    <td className="tc-detail-cell">
                      {openTool ? openTool.label : ""}
                    </td>
                    <td colSpan={visibleTools.length} className={"tc-detail-cell" + (isRec ? " tc-detail-recommend" : "")}>
                      {openCell.detail}
                    </td>
                  </tr>);
      }
    }
    return rows;
  })}
        </tbody>
      </table>
    </div>;
  const renderMobile = () => {
    const activeTool = safeTools.find(t => t.id === mobileTool) || safeTools[0];
    return <div className="tc-mobile">
        <div className="tc-mob-tabs" role="tablist">
          {safeTools.map(tool => <button key={tool.id} type="button" role="tab" aria-selected={tool.id === mobileTool ? "true" : "false"} className={"tc-mob-tab" + (tool.id === mobileTool ? " tc-mob-tab-on" : "")} onClick={() => setMobileTool(tool.id)}>
              {tool.label}
            </button>)}
        </div>

        <div className="tc-mob-cards">
          {safeDimensions.map(dim => {
      const cell = (dim.cells || ({}))[activeTool.id] || ({});
      const isRec = !!cell.recommend;
      return <div key={dim.id} className="tc-mob-card">
                <div className="tc-mob-dim">{dim.label}</div>
                <div className="tc-mob-val">{renderValue(cell)}</div>
                {isRec && <div className="tc-mob-rec">{UI.recommend}</div>}
                {cell.detail && <div className="tc-mob-detail">{cell.detail}</div>}
              </div>;
    })}
        </div>
      </div>;
  };
  return <div className="tc-root">
      <style>{css}</style>

      {}
      <div className="tc-filter-bar">
        <button type="button" className={"tc-pill tc-pill-all" + (isAllSelected ? " tc-pill-on" : "")} onClick={toggleAll} aria-pressed={String(isAllSelected)}>
          {UI.allTools}
        </button>

        {}
        <span className="tc-filter-sep" aria-hidden="true" />

        {safeTools.map(tool => {
    const isOn = selectedIds.includes(tool.id);
    return <button key={tool.id} type="button" className={"tc-pill" + (isOn ? " tc-pill-on" : "")} onClick={() => toggleTool(tool.id)} aria-pressed={String(isOn)}>
              {isOn && <span className="tc-pill-dot" aria-hidden="true" />}
              {tool.label}
            </button>;
  })}
      </div>

      {}
      {visibleTools.length > 0 && renderDesktopTable()}

      {}
      {renderMobile()}

      {}
      {notes.length > 0 && <div className="tc-notes">
          <div className="tc-notes-label">{UI.notes}</div>
          {notes.map((note, i) => <div key={i} className="tc-note-item">{note}</div>)}
        </div>}
    </div>;
};

export const LearnerPrimer = ({items = [], lang = "zh"}) => {
  const t = lang === "en" ? {
    title: "Before this unit, be honest with yourself",
    sub: "If you can't answer these, that gap is exactly what this unit closes."
  } : {
    title: "讀這個單元前，先誠實面對",
    sub: "這幾題答不出來，正是這個單元要替你補的洞。"
  };
  const css = `
  .lp-root{--lp-bg:#FAF7F1;--lp-surface:rgba(191,117,81,0.05);--lp-border:rgba(0,0,0,0.09);--lp-edge:rgba(191,117,81,0.42);--lp-text:#2b2722;--lp-dim:#6f6a62;--lp-accent:#bf7551;border:1px solid var(--lp-border);border-left:3px solid var(--lp-edge);border-radius:13px;background:var(--lp-bg);color:var(--lp-text);overflow:hidden;margin:1.25rem 0;}
  .dark .lp-root{--lp-bg:#1b1a18;--lp-surface:rgba(207,138,104,0.07);--lp-border:rgba(255,255,255,0.08);--lp-edge:rgba(207,138,104,0.5);--lp-text:#e7e3da;--lp-dim:#a8a299;--lp-accent:#cf8a68;}
  .lp-head{display:flex;align-items:center;gap:9px;padding:13px 18px 11px;border-bottom:1px solid var(--lp-border);background:var(--lp-surface);}
  .lp-ic{color:var(--lp-accent);flex-shrink:0;}
  .lp-htx{display:flex;flex-direction:column;gap:1px;min-width:0;}
  .lp-title{font-size:14px;font-weight:650;line-height:1.3;letter-spacing:.01em;}
  .lp-sub{font-size:12px;color:var(--lp-dim);line-height:1.4;}
  .lp-list{list-style:none;margin:0;padding:10px 18px 14px;display:flex;flex-direction:column;gap:0;}
  .lp-item{display:flex;align-items:baseline;gap:11px;padding:7px 0;font-size:14px;line-height:1.6;border-top:1px solid var(--lp-border);}
  .lp-item:first-child{border-top:none;}
  .lp-mark{flex-shrink:0;color:var(--lp-accent);font-size:13px;font-weight:700;line-height:1.55;font-variant-numeric:tabular-nums;opacity:.85;}
  .lp-q{flex:1 1 0;min-width:0;color:var(--lp-text);}
  @media (max-width:620px){.lp-head{padding:12px 14px 10px;}.lp-list{padding:8px 14px 12px;}}
  `;
  return <div className="lp-root">
      <style>{css}</style>
      <div className="lp-head">
        <svg className="lp-ic" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="10" /><circle cx="12" cy="12" r="6" /><circle cx="12" cy="12" r="2" /></svg>
        <span className="lp-htx">
          <span className="lp-title">{t.title}</span>
          <span className="lp-sub">{t.sub}</span>
        </span>
      </div>
      <ul className="lp-list">
        {items.map((q, i) => <li className="lp-item" key={i}>
            <span className="lp-mark">{String(i + 1).padStart(2, "0")}</span>
            <span className="lp-q">{q}</span>
          </li>)}
      </ul>
    </div>;
};

<LearnerPrimer
  lang="en"
  items={[
"Subagents die once; Agent Teams persist.",
"5 workers in parallel = 5x context cost.",
"Workers use Haiku; only the Lead needs Sonnet.",
"Starting with 3 teammates is over-engineering.",
"Dependent subtasks run slower in parallel than in sequence.",
"Message loops without a termination condition silently deadlock.",
"Teammates do not inherit SOUL.md -- do not expect it.",
]}
/>

<Info>
  **What this unit solves**

  Subagents are one-shot executors: they are spawned, finish a task, return a result, and their context does not persist. Agent Teams are addressable, continuously running, collaborative agents: once created they retain an identity, can receive messages, exchange state with other agents, and pick up tasks. This unit clarifies the lifecycle differences between the two mechanisms, how each is enabled, and covers three collaboration patterns -- orchestrator-worker, parallel independent work, and peer messaging -- so you can choose the right tool and avoid over-engineering your automation flows.
</Info>

## Learning objectives

After completing this unit you should be able to:

* [ ] Distinguish the fundamental difference between a Subagent (one-shot spawn, result returned to the caller, context does not persist) and Agent Teams (addressable, continuously alive, collaborative).
* [ ] Describe how each is enabled and its current limitations (as of 2026-06, Agent Teams is an experimental feature).
* [ ] Name the three collaboration patterns (orchestrator-worker, parallel independent work, peer messaging) and identify the scenario each fits.
* [ ] Decide whether a given task calls for a Subagent, Agent Teams, or no multi-agent architecture at all.

***

## 1. Definitions and core differences

Anthropic introduced **Agent Teams** starting with Claude Code v2.1.32 \[1]. It is a separate multi-agent layer from [04-5 Subagents](/en/code-agent/customization/subagents): instead of "spawn, run to completion, disappear," it means "multiple Claude Code instances organized as a team, sharing a task list, messaging each other, addressable by both the user and the lead."

<Note>
  **Naming clarification**

  This unit uses **Subagent** for the mechanism described in [04-5](/en/code-agent/customization/subagents) (one-shot, isolated context, returns a result), and **Agent Teams** for the "agent teams" / teammate concept in Anthropic's documentation (persistent, addressable, collaborative). **Subagents and Agent Teams are independent mechanisms that can coexist**: a single session can have both simultaneously, each playing a different role.
</Note>

Core differences (as of 2026-06, per the official agent teams section \[1]):

| Dimension         | Subagent                                                                                  | Agent Teams                                                                                   |
| ----------------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| Lifecycle         | Terminated when the task ends                                                             | Persists until the lead dissolves the team                                                    |
| Addressability    | Not addressable (caller initiates spawn)                                                  | Addressable by lead, other teammates, and the user                                            |
| Context           | Fresh context on every spawn                                                              | Persists across turns (each teammate accumulates its own context)                             |
| Communication     | Returns result to caller only                                                             | Bidirectional messaging via mailbox, shared task list, idle notification                      |
| Concurrency limit | Multiple spawns allowed within the same session                                           | One lead manages one team at a time \[1]                                                      |
| Nesting           | Cannot spawn subagents                                                                    | Teammates cannot spawn a team or other teammates \[1]                                         |
| Token cost        | Lower (only the summary result returns to the caller)                                     | Higher (each teammate holds a full context window)                                            |
| Ideal for         | One-shot subtasks, read-only queries, parallel work where results do not need to interact | Sustained collaboration, multi-round feedback, shared state, user intervention during the run |

<Tip>
  **Connection to [01-4 Context Engineering](/en/code-agent/foundations/context-engineering)**

  A Subagent is like "moving a big task to swap space" -- the main RAM only sees the result. Agent Teams is "opening N independent RAM modules that can pass messages to each other." The former saves context; the latter buys collaborative capability. **Choosing the wrong one means either burning tokens without a result, or trying to save tokens by cramming multi-round dialogue into a single context window and watching output quality degrade.**
</Tip>

## 2. How to enable each

### 2.1 Subagents ([04-5](/en/code-agent/customization/subagents) covers this in full)

Invoke explicitly from a session or a skill with `Agent(<name>)`, or let Claude auto-delegate based on the `description` field. Subagent definitions live in `.claude/agents/`, the user-level `~/.claude/agents/`, a plugin's `agents/` directory, managed settings, or the `--agents` CLI flag. The lifecycle is exactly: spawn, run the task, return the result, terminate.

### 2.2 Agent Teams

**As of 2026-06, Agent Teams is an experimental feature, disabled by default** \[1]. To enable:

```json theme={null}
// .claude/settings.json or ~/.claude/settings.json
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}
```

Or set the environment variable before launching:

```bash theme={null}
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 claude
```

Once enabled, ask Claude in natural language to build a team:

```text theme={null}
I want to design a CLI tool that tracks TODO comments in a codebase.
Build an agent team and explore this from three angles: UX, technical architecture, and devil's advocate.
```

Claude will create the team, spawn teammates, have each explore independently, and then synthesize the results \[1].

<Warning>
  **Current limitations of Agent Teams**

  * Disabled by default; requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`.
  * In in-process mode, `/resume` and `/rewind` do not restore teammates; after resuming the lead may try to contact a teammate that no longer exists \[1].
  * Task status can lag (a teammate that fails to mark a task completed blocks dependent tasks) \[1].
  * One lead can manage only one team at a time; tear down the current team before starting a new one.
  * Teammates cannot spawn their own team or other teammates.
  * The lead is fixed and cannot be transferred after session start.
  * All teammates inherit the lead's permission mode at spawn time; individual permissions cannot be set separately.
  * Split-pane mode requires tmux or iTerm2 (VS Code integrated terminal, Windows Terminal, and Ghostty are not supported) \[1].
</Warning>

### 2.3 Display modes

Agent Teams supports two display modes \[1]:

| Mode                          | Setting                      | Behavior                                                                                                                      |
| ----------------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| in-process (default fallback) | `teammateMode: "in-process"` | All teammates run within the main terminal. `Shift+Down` cycles between them; you can send messages directly to any teammate. |
| split-pane                    | `teammateMode: "tmux"`       | Each teammate gets its own pane. Requires tmux or iTerm2 + the `it2` CLI.                                                     |

The default is `auto`: uses split-pane when launched inside a tmux session, otherwise falls back to in-process. To force a mode:

```bash theme={null}
claude --teammate-mode in-process
```

<Note>
  **Split-pane on Windows: psmux or WSL tmux**

  Neither tmux nor iTerm2 is Windows-native, so Windows users will land on in-process by default. Two paths exist for split-pane on Windows:

  * **psmux**: a Rust-based native Windows terminal multiplexer, compatible with existing `.tmux.conf`, no WSL or Cygwin required. Launch Claude Code inside a psmux session and teammates automatically open in separate panes. As of 2026-06 this is still a new project (version 0.1.x); evaluate its maintenance status before adopting it \[4].
  * **WSL tmux**: install tmux inside WSL and run Claude Code from a WSL terminal. Split-pane behaves identically to native tmux, provided your project and toolchain are accessible on the WSL side.
</Note>

### 2.4 Model selection

Teammates do not inherit the lead's `/model` setting by default. To set a default teammate model: run `/config` inside Claude Code and select **Default teammate model**. Choosing "Default (leader's model)" makes all teammates use the same model as the lead \[1].

## 3. Collaboration patterns

### 3.1 Orchestrator-worker

A lead agent breaks down a task, then spawns multiple Subagents in sequence or in parallel, collects each result, and integrates them. **Subagents are unaware of each other's existence.**

```text theme={null}
Lead: split this PR into three analysis tracks
  |-- spawn Subagent A (security)
  |-- spawn Subagent B (performance)
  +-- spawn Subagent C (style)
  collect three results, merge into one response
```

Agent Teams can implement this pattern too, but at greater cost. **When Subagents are sufficient**: each worker is independent, read-oriented, and its result can be merged; workers do not need to talk to each other.

### 3.2 Parallel independent work

Multiple Subagents process non-overlapping subtasks simultaneously (each operating on different files or modules); the main thread merges results at the end. **The most common multi-agent pattern and the simplest to implement.**

Agent Teams can do this too, but adds unnecessary complexity. **The criterion: workers do not need to communicate and results can be merged -- Subagents are enough.**

### 3.3 Peer messaging

Agent Teams communicate via mailbox, negotiating state across messages. **Suited for workflows that require multiple rounds of feedback:**

* A reviewer sends comments back to a writer; the writer revises and sends back to the reviewer.
* Multiple investigators each propose a hypothesis, challenge each other's reasoning, and converge on a conclusion.
* Multiple parallel exploration threads are finally integrated by the lead into a single synthesis.

<Note>
  **Pattern selection examples**

  **Scenario 1: code review**
  Three reviewers (security / performance / test coverage) each examine the same PR and return results. → **Subagents are enough** (results merge; no dialogue needed).

  **Scenario 2: evaluating an open-source project**
  A research-owner agent sends three Subagents to examine "code quality," "community health," and "licensing and maintenance." Three results merge into a single recommendation. → **Subagents are enough.**

  **Scenario 3: bug investigation with unknown root cause**
  Spawn 5 teammates, each proposing one hypothesis, each challenging the others, each leaving behind evidence that survived the challenge. → **Agent Teams add value** (requires message exchange and a debate structure).

  **Scenario 4: writer + reviewer iterating on a document draft**
  Writer drafts, reviewer comments, writer revises, reviewer reviews again, multiple rounds until convergence. → **Agent Teams** (a Subagent dies after one round and cannot hold a multi-turn conversation).
</Note>

## 4. Independent operation

### 4.1 When to let agents avoid each other

Subtasks with **no shared mutable state** (each reads different data, writes different files) → parallel independent work is the simplest and requires no synchronization mechanism.

Implementation: each Subagent / teammate works in a separate worktree. Git worktrees are the physical isolation tool (see [04-5](/en/code-agent/customization/subagents)):

```bash theme={null}
# create a separate worktree for each worker
git worktree add ../agent-A -b agent-A-branch
git worktree add ../agent-B -b agent-B-branch
```

### 4.2 When shared state is unavoidable

Task B's input depends on Task A's output → use **sequential orchestration** (B starts only after A finishes) or **Agent Teams peer messaging**; do not use parallel execution.

Parallel work is especially fragile when dependencies exist: if A and B are both instructed to "read the same file and modify different sections," the final merge will conflict. **Map out dependencies first**: if two tasks share mutable state, run them sequentially or let Agent Teams coordinate the exchange.

### 4.3 Strengthen the workflow with TeammateIdle / TaskCreated / TaskCompleted hooks

Agent Teams exposes three dedicated hook event points \[1, see [04-6 Hooks](/en/code-agent/customization/hooks)]:

* `TeammateIdle`: teammate is about to enter idle. Return `exit 2` to give feedback and keep it working.
* `TaskCreated`: a task is being created. Return `exit 2` to block creation.
* `TaskCompleted`: a task is being marked complete. Return `exit 2` to reject completion and give feedback.

These three events are the right places for "teammate collaboration quality gates": teammate finishes writing code but hasn't run tests and is about to go idle? Block with `TeammateIdle`. Teammate marks a task complete but the commit message doesn't follow team conventions? Reject with `TaskCompleted`.

```json theme={null}
{
  "hooks": {
    "TeammateIdle": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/require-tests.sh"
          }
        ]
      }
    ]
  }
}
```

## 5. Cost and complexity

### 5.1 When not to parallelize

Parallel execution adds extra context cost and coordination complexity. **If subtasks depend on each other, or if integrating results costs more than the decomposition saves, run sequentially.**

Three cost-evaluation questions:

1. **Are the subtasks truly orthogonal?** Shared input, cross-reads and cross-writes, shared mutable state → not orthogonal; parallel execution will actually be slower.
2. **Is integrating the results manageable?** If three results contradict each other and require extensive secondary coordination → the gains from decomposition disappear.
3. **Does the speedup from parallelism offset the extra token cost?** 5 Haiku workers vs 1 Sonnet run end-to-end: 5 workers burn 5x context; 5x speedup is the theoretical ceiling. **Real-world speedup is often only 2-3x** (due to communication overhead, synchronization, and idle time).

### 5.2 Model selection

Worker agents should use the cheapest model available (Haiku); only the main orchestrator or lead needs Sonnet or Opus reasoning capability (see [04-5](/en/code-agent/customization/subagents)).

Agent Teams does not inherit the lead's model by default (\[1] section 2.4); explicit assignment is required to control costs:

```text theme={null}
Create a team with 4 teammates to refactor these modules in parallel.
Use Sonnet for each teammate.
```

Alternatively use `/config` to set the default teammate model to a Haiku-class model.

### 5.3 Known limitations

Agent Teams is an experimental feature. Officially documented limitations \[1]:

* In in-process mode, resume does not restore teammates.
* Task status can lag.
* Shutdown can be slow (teammates finish their current tool call before stopping).
* One lead can manage only one team.
* No nesting.
* Lead is fixed and cannot be transferred.
* Permission mode is decided at spawn time; it cannot be changed after the team starts.
* Split-pane mode requires tmux or iTerm2.

<Tip>
  **`CLAUDE.md` works normally for teammates**

  Anthropic explicitly states that teammates read `CLAUDE.md` as project-level guidance \[1]. This is the most direct way to govern teammate behavior. Put cross-teammate conventions in `CLAUDE.md` rather than relying on the lead to explain them every time.
</Tip>

## 6. Tool comparison

<ToolCompare
  lang="en"
  tools={[
{ id: "claude",  label: "Claude Code" },
{ id: "codex",   label: "OpenAI Codex" },
{ id: "gemini",  label: "Google Gemini CLI" },
{ id: "copilot", label: "GitHub Copilot" },
{ id: "cursor",  label: "Cursor" },
]}
  dimensions={[
{
  id: "one-shot",
  label: "One-shot sub-agent",
  cells: {
    claude:  { value: "Subagent (`Agent(<name>)` tool) [2]", recommend: true, detail: "Spawned, executes a task, returns a result, context does not persist. Defined in .claude/agents/ or ~/.claude/agents/; supports isolation: worktree for physical isolation." },
    codex:   { value: "No native equivalent", detail: "OpenAI Codex CLI is a single-agent design with no native sub-agent spawning; multi-workflow requires manual separation or the API-level Assistants mechanism (as of 2026-06, per official docs [5])." },
    gemini:  { value: "No native equivalent", detail: "Gemini CLI is a single-agent design with no native sub-agent spawning; multi-agent patterns require the API or external frameworks such as LangChain/LangGraph (as of 2026-06, per official docs [6])." },
    copilot: { value: "No native equivalent", detail: "GitHub Copilot CLI operates in suggest/explain mode with no native sub-agent spawning mechanism (as of 2026-06, per official docs [7])." },
    cursor:  { value: "No native equivalent", detail: "Cursor is IDE-centric with no native sub-agent spawning mechanism; multi-agent patterns require API-level implementation (as of 2026-06, per official docs [8])." },
  },
},
{
  id: "persistent",
  label: "Persistent / addressable agent",
  cells: {
    claude:  { value: "Agent Teams (v2.1.32+, experimental) [1]", recommend: true, detail: "Multiple Claude Code instances form a team, share a task list, exchange messages, and can be addressed directly by the user or the lead. Enable with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1." },
    codex:   { value: "OpenAI Assistants API (not CLI-native)", detail: "OpenAI provides the Assistants API (Threads, Runs, persistent memory) for persistent addressable agents, but this is an API-level feature, not native to the Codex CLI (as of 2026-06, per official Assistants API docs [5])." },
    gemini:  { value: "No CLI-native persistent agent mechanism", detail: "Gemini CLI itself has no persistent addressable agent mechanism; persistent agents require Vertex AI Agent Builder or API-level implementation (as of 2026-06, per official docs [6])." },
    copilot: { value: "No native persistent agent mechanism", detail: "GitHub Copilot CLI has no persistent addressable agent mechanism; GitHub Copilot Extensions can provide richer tool integration but are not a multi-agent architecture (as of 2026-06, per official docs [7])." },
    cursor:  { value: "No native persistent agent mechanism", detail: "Cursor's Background Agent feature runs a single task in the background; it is not a multi-agent collaboration architecture (as of 2026-06, per official docs [8])." },
  },
},
{
  id: "shared-tasks",
  label: "Shared task list",
  cells: {
    claude:  { value: "Yes (`~/.claude/tasks/<team>/`) [1]", recommend: true },
    codex:   { na: true },
    gemini:  { na: true },
    copilot: { na: true },
    cursor:  { na: true },
  },
},
{
  id: "inter-agent-msg",
  label: "Inter-agent messaging",
  cells: {
    claude:  { value: "Yes (mailbox + `SendMessage`) [1]", recommend: true },
    codex:   { na: true },
    gemini:  { na: true },
    copilot: { na: true },
    cursor:  { na: true },
  },
},
{
  id: "hook-events",
  label: "Teammate hook events",
  cells: {
    claude:  { value: "TeammateIdle, TaskCreated, TaskCompleted [1, 3]", recommend: true, detail: "exit 2 intercepts and provides feedback. TeammateIdle forces a teammate to keep working; TaskCompleted serves as a quality gate." },
    codex:   { na: true },
    gemini:  { na: true },
    copilot: { na: true },
    cursor:  { na: true },
  },
},
{
  id: "display-modes",
  label: "Display modes",
  cells: {
    claude:  { value: "in-process / split-pane (tmux / iTerm2) [1]", recommend: true, detail: "auto mode: split-pane when launched inside a tmux session, otherwise in-process. On Windows, use psmux or WSL tmux to get split-pane." },
    codex:   { value: "Single terminal output", detail: "Codex CLI presents output in a single terminal (interactive or non-interactive); no multi-pane multi-agent display mode (as of 2026-06)." },
    gemini:  { value: "Single terminal output", detail: "Gemini CLI presents output in a single terminal or via --prompt non-interactive mode; no multi-pane multi-agent display mode (as of 2026-06)." },
    copilot: { value: "Single terminal output", detail: "GitHub Copilot CLI presents gh copilot suggest/explain output in a single terminal; no multi-pane display mode (as of 2026-06)." },
    cursor:  { value: "IDE multi-pane integration", detail: "Cursor presents agent output through the IDE pane system; not designed for multi-agent collaboration display (as of 2026-06)." },
  },
},
{
  id: "isolation",
  label: "Physical isolation",
  cells: {
    claude:  { value: "`isolation: worktree` ([2])", recommend: true, detail: "Set isolation: worktree in the Subagent frontmatter to automatically create a dedicated git worktree, preventing conflicts when multiple agents operate concurrently." },
    codex:   { value: "Docker / sandbox environment", detail: "Codex CLI supports --sandbox mode, isolating execution in a Docker container (as of 2026-06, per official docs [5])." },
    gemini:  { value: "Docker / sandbox environment", detail: "Gemini CLI supports --sandbox mode, isolating execution in a Docker container (as of 2026-06, per official docs [6])." },
    copilot: { value: "Local environment execution", detail: "GitHub Copilot CLI commands run in the local environment with no built-in container isolation (as of 2026-06, per official docs [7])." },
    cursor:  { value: "IDE sandbox / remote environment", detail: "Cursor's Background Agent supports execution in a remote sandbox environment to reduce local environment impact (as of 2026-06, per official docs [8])." },
  },
},
]}
  notes={[
"Agent Teams (v2.1.32+) is an experimental feature, disabled by default; enable with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 [1].",
"OpenAI Assistants API provides a persistent-agent concept, but it is an API-level feature, not a native multi-agent mechanism in the Codex CLI.",
"Cursor is a third-party IDE (Anysphere); this Playbook includes only a brief column for it.",
]}
/>

<Note>
  **Naming and boundaries**

  * **Agent Teams (v2.1.32+)** is an experimental feature, disabled by default; enabled with `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` \[1].
  * For OpenAI, GitHub Copilot, and Cursor, the specific multi-agent mechanisms follow each vendor's current official documentation.
  * **Cursor is a third-party IDE** (Anysphere); this Playbook only covers it briefly in one column.
</Note>

## Hands-on exercises

<Steps>
  <Step title="Run each of the three patterns once (20 minutes)">
    **Orchestrator-worker (Subagent)**: in your current project, use three Subagents in parallel to review from security, performance, and test-coverage angles. Observe the cost of integrating three results in the main thread.

    **Parallel independent work (Subagent)**: have three Subagents each refactor a different module. Observe whether worktree isolation turns out to be necessary.

    **Peer messaging (Agent Teams -- first enable `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`)**: build a team of 3 teammates and have them each propose a hypothesis about an unfamiliar bug, then challenge each other. **Observe whether token cost is noticeably higher than the Subagent patterns above.**
  </Step>

  <Step title="Strengthen the workflow with a hook (10 minutes)">
    Add a `TeammateIdle` hook to `.claude/settings.json`, switch to `tmux` mode with `/teammateMode` (or stay in in-process), and verify the hook fires.
  </Step>
</Steps>

## Common pitfalls

<Warning>
  **Anti-pattern list**

  * **Designing dependent subtasks as parallel work**: integration requires extensive secondary coordination and ends up slower than a sequential run. Map dependencies first using [01-5 Workflow Engineering](/en/code-agent/foundations/workflow-engineering).
  * **Agent Teams message loops without a termination condition**: leads to infinite message exchanges or silent deadlock. **Every message exchange must have an explicit exit condition** (accept / reject / escalate).
  * **Using the strongest model for every agent**: ignores the fact that worker tasks are fine on Haiku, and lets cost spiral. **Workers use Haiku; the Lead uses Sonnet/Opus.**
  * **Treating Agent Teams like threads**: Agent Teams are full Claude Code instances with a complete context window, full tool access, and full permissions -- not "cheap Subagents." **Expect their token usage to match that of an independent session.**
  * **Forgetting that `CLAUDE.md` applies to teammates**: teammates do not inherit the lead's conversation history, but they do read the project's `CLAUDE.md` \[1]. **Write cross-teammate conventions into `CLAUDE.md`; do not rely on the lead to re-explain them every run.**
  * **Using Agent Teams for small tasks**: a 5-line grep is a Subagent job; teams are designed for collaborative, multi-round work. **Starting with 3 teammates is over-engineering** \[1].
</Warning>

## Self-check

<Check>
  **The bar for passing this unit**

  1. Can you produce a table showing how Subagents and Agent Teams differ across lifecycle, addressability, communication mechanism, and token cost?
  2. Can you decide which mechanism fits each of these three tasks?
     * Refactoring three independent modules
     * Generating multiple competing hypotheses about an unknown bug
     * Adding a feature that spans 5 files (5 self-contained subtasks)
  3. In your most recent multi-agent design, were the subtasks genuinely orthogonal -- or did they just feel like they should be parallel?
  4. Does your `CLAUDE.md` state explicit criteria for "which tasks go to a Subagent" vs "which go to Agent Teams"?
</Check>

## Sources and further reading

Factual claims are grounded in official documentation; fast-changing items are annotated as of 2026-05.

<div className="references">
  * \[1] Anthropic, "Orchestrate teams of Claude Code sessions," code.claude.com, 2026. \[Online]. Available: [https://code.claude.com/docs/en/agent-teams](https://code.claude.com/docs/en/agent-teams) (as of 2026-06; v2.1.32+ enablement, `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`, mailbox, shared task list, teammate hook events, display modes, known limitations)

  * \[2] Anthropic, "Create custom subagents," code.claude.com, 2026. \[Online]. Available: [https://code.claude.com/docs/en/sub-agents](https://code.claude.com/docs/en/sub-agents) (as of 2026-06; full subagent frontmatter, `isolation: worktree`, `skills` preloading, `Task` renamed to `Agent` in v2.1.63)

  * \[3] Anthropic, "Hooks," code.claude.com, 2026. \[Online]. Available: [https://code.claude.com/docs/en/hooks](https://code.claude.com/docs/en/hooks) (as of 2026-06; TeammateIdle, TaskCreated, TaskCompleted events, `exit 2` interception semantics)

  * \[4] psmux, "psmux: native terminal multiplexer for Windows," GitHub, 2026. \[Online]. Available: [https://github.com/psmux/psmux](https://github.com/psmux/psmux) (as of 2026-06; Rust single binary, compatible with `.tmux.conf`, Windows-native, no WSL or Cygwin required; teammates automatically open in separate panes when Claude Code is launched inside a psmux session; version 0.1.x, a new project)

  * \[5] OpenAI, "Codex CLI," developers.openai.com, 2026. \[Online]. Available: [https://developers.openai.com/codex](https://developers.openai.com/codex) (as of 2026-06; single-agent design, no native sub-agent spawning; multi-agent via Assistants API; --sandbox Docker isolation)

  * \[6] Google, "Gemini CLI," google-gemini.github.io, 2026. \[Online]. Available: [https://google-gemini.github.io/gemini-cli/](https://google-gemini.github.io/gemini-cli/) (as of 2026-06; single-agent design, no native sub-agent spawning; multi-agent via Vertex AI Agent Builder or external frameworks; --sandbox mode)

  * \[7] GitHub Docs, "GitHub Copilot CLI," docs.github.com, 2026. \[Online]. Available: [https://docs.github.com/en/copilot/how-tos/copilot-cli](https://docs.github.com/en/copilot/how-tos/copilot-cli) (as of 2026-06; suggest/explain mode, no native sub-agent or persistent agent mechanism; Extensions for richer tool integration)

  * \[8] Cursor, "Background Agent," cursor.com, 2026. \[Online]. Available: [https://cursor.com/docs/background-agent](https://cursor.com/docs/background-agent) (as of 2026-06; single background task execution, not a multi-agent collaboration architecture; remote sandbox environment)
</div>

* Subagent design and `isolation: worktree`: [04-5 Subagents](/en/code-agent/customization/subagents).
* Combining Skills with Subagents: [04-4 Skills](/en/code-agent/customization/skills).
* Cross-agent integration interfaces: [04-9 MCP Integration](/en/code-agent/customization/mcp-integration).
* Enforcement via hooks: [04-6 Hooks](/en/code-agent/customization/hooks).
* Context isolation concepts: [01-4 Context Engineering](/en/code-agent/foundations/context-engineering).
* Multi-step task orchestration: [01-5 Workflow Engineering](/en/code-agent/foundations/workflow-engineering).
