Week 4 · Further reading
Many agents, in more depth
The slides covered the main ideas. This page has the details and the evidence, with sources, checked on October 13, 2026. Multi-agent features change monthly: when this page and a product's docs disagree, trust the docs.
1. Subagents in Claude Code and Codex
- Claude Code: Markdown files in
.claude/agents/(or~/.claude/agents/), withnameanddescriptionrequired and optionaltools,model,permissionMode,maxTurns,skills,mcpServers,hooks,isolation: worktreeand more; the body is the system prompt. Built in: Explore (read-only), Plan, general-purpose. Since 2026 subagents can start subagents, three levels deep by default. - Codex: TOML files in
.codex/agents/withname,descriptionanddeveloper_instructions; built in: default, worker, explorer. On by default; Codex delegates when asked or when instructions say to. Its docs name the reasons plainly: "context pollution" and "context rot". Parallelize reading; be careful with parallel writing. - OpenAI Agents SDK: two ways to combine agents. Agents as tools: a manager keeps control and calls specialists. Handoffs: a triage agent passes the conversation to a specialist, which takes over.
Claude Code: subagents · Codex: subagents · OpenAI Agents SDK: multi-agent
2. Workflows, and who decides
Anthropic's "Building effective agents" (December 2024) separates workflows, "LLMs and tools orchestrated through predefined code paths", from agents, where "LLMs dynamically direct their own processes and tool usage", and names five workflow patterns: prompt chaining, routing, parallelization, orchestrator–workers and evaluator–optimizer. Its advice: "find the simplest solution possible, and only increase complexity when needed."
Claude Code's dynamic workflows (May 2026) make the idea concrete: Claude writes a short JavaScript script with agent(), parallel()
and pipeline(), and a runtime executes it, so the plan lives in code and intermediate results stay out of Claude's context.
Defaults: 16 agents at once, up to 1,000 per run, and no user input mid-run. Anthropic's headline example rewrote the Bun runtime from Zig to Rust,
about 750,000 lines with 99.8% of its tests passing, in eleven days (a vendor claim).
Anthropic: building effective agents · Claude Code: workflows · Introducing dynamic workflows
3. Peer agents and agent teams
Claude Code's agent teams (experimental since February 2026; turn on with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) are the peer shape as a product:
a lead session starts teammates, each a full Claude Code session with its own context (it loads CLAUDE.md, MCP servers and skills, but not the lead's conversation).
They share a task list (pending, in progress, done, with dependencies; claiming uses file locks) and a mailbox per agent, messaging each other by name.
- Advice from the docs: start with 3–5 teammates; "three focused teammates often outperform five scattered ones"; token cost grows with team size.
- Good for research and review, and for debugging with competing hypotheses, where teammates try to disprove each other. Bad for sequential work or editing the same file.
- Limits: one team per session, no nested teams, a fixed lead.
- Safety: a message from another agent is marked as such and can't approve a permission prompt for you.
4. The evidence: when it helps
- Anthropic's research system (June 2025): a lead agent (Claude Opus 4) with parallel subagents (Claude Sonnet 4) beat a single Opus 4 agent by 90.2% on their research evaluation. On a browsing benchmark, token use alone explained 80% of the variance in performance. Agents use about 4× the tokens of a chat, multi-agent systems about 15×.
- "Towards a Science of Scaling Agent Systems" (Google Research, Google DeepMind and MIT; v3, April 2026; 260 configurations, 6 benchmarks, GPT, Gemini and Claude): a coordinated team improved a parallelizable finance task by about 81%; every multi-agent design degraded a sequential planning task by 39–70%; independent agents amplified errors 17.2×, against 4.4× with a central coordinator; and once a single agent scored above about 45%, more agents gave negative returns. On SWE-bench Verified every multi-agent variant was slightly worse (−15% to −2%). A simple model of the task picks the best design for 87% of held-out cases.
- Cognition, "Don't Build Multi-Agents" (June 2025): "Share context, and share full agent traces, not just individual messages"; "Actions carry implicit decisions, and conflicting decisions carry bad results."
Anthropic: our multi-agent research system · arXiv 2512.08296 and the Google Research blog · Cognition: don't build multi-agents
5. How multi-agent systems fail
MAST (Cemri et al., NeurIPS 2025) annotated 1,642 traces from 7 open-source frameworks; between 41% and 86.7% of tasks failed. Fourteen failure modes in three groups:
| Group | Share | Failure modes (share of all failures) |
|---|---|---|
| System design | ~44% | step repetition 15.7%, unaware of when to stop 12.4%, disobeying the task 11.8%, losing history 2.8%, disobeying the role 1.5% |
| Inter-agent misalignment | ~32% | reasoning–action mismatch 13.2%, task derailment 7.4%, not asking for clarification 6.8%, conversation reset 2.2%, ignoring another agent 1.9%, withholding information 0.85% |
| Task verification | ~24% | incorrect verification 9.1%, no or incomplete verification 8.2%, stopping too early 6.2% |
Simple fixes helped only modestly: better role descriptions +9.4%, a verification step +15.6% on one framework.
The echo chamber
- Choi, Zhu and Li, "Debate or Vote" (NeurIPS 2025): across 7 benchmarks, majority voting accounts for most of the gains credited to multi-agent debate.
- Huang et al., "Large Language Models Cannot Self-Correct Reasoning Yet" (ICLR 2024): with the same number of answers, debate underperformed simple majority voting.
- Wynn, Satija and Hadfield, "Talk Isn't Always Cheap" (2025): debate can lower accuracy; agents switch from right to wrong answers and favor agreement.
- Bertalanič and Fortuna, "The Cost of Consensus" (2026 preprint): agents adopted the majority answer uncritically; peers' arguments flipped correct reasoning up to 70% of the time, at 2.1–3.4× the tokens.
The counterpoint: debate helps when agents differ and when verification is grounded in something outside the conversation. Settle disagreements with tools and tests. For research, two agents that read the same sources are not independent reviewers, and agents citing each other can turn one guess into a consensus.
6. Two large experiments, and one for science
- Anthropic, "Building a C compiler with a team of parallel Claudes" (Nicholas Carlini, February 2026). 16 agents, about 2,000 sessions over two weeks, just under $20,000: about 100,000 lines of Rust that build Linux 6.9 on x86, ARM and RISC-V and pass 99% of most compiler test suites. No orchestrator: each agent ran in a loop in its own Docker container, all pushing to one git repository, claiming tasks with lock files in
current_tasks/. Lessons: the tests must be nearly perfect; use GCC as an oracle to split the work; keep output short to avoid context pollution; give agents specialized roles. Limitations: optimized output is worse than GCC with optimizations off, and regressions were frequent. - Cursor, "Scaling long-running autonomous coding" (January 2026). Hundreds of concurrent agents built a web browser, over a million lines, in about a week. Flat peers with locks failed ("Twenty agents slowed to the throughput of two or three"); what worked was planners that create tasks, workers that execute without coordinating with each other, and a judge that decides each cycle whether to continue, with periodic fresh starts.
- Google's AI co-scientist (Nature, May 2026): generation, reflection ("virtual peer reviewer"), ranking (a tournament of pairwise debates), evolution and meta-review agents under a supervisor. A drug-repurposing candidate it proposed for liver fibrosis worked in lab tests. Critics note that no false-positive rate is published.
7. A2A
The Agent2Agent protocol (Google, April 2025; version 1.0 in March 2026; at the Linux Foundation's Agentic AI Foundation since August 2026, next to MCP) lets an agent delegate to another agent it doesn't control.
An agent publishes an Agent Card at https://{domain}/.well-known/agent-card.json: its name, skills, endpoint and how to authenticate.
A client sends a task; the task moves through states (submitted, working, input-required, auth-required, completed, failed, canceled, rejected) and returns
messages and artifacts made of parts (text, files, data). Bindings: JSON-RPC, gRPC and HTTP. Over 150 organizations support it; it runs in Azure AI Foundry, Copilot Studio and Amazon Bedrock AgentCore.
8. Sandboxes for many agents
A container shares the host's kernel; gVisor puts a user-space kernel in between; a microVM gives each sandbox its own kernel behind hardware virtualization. Firecracker microVMs boot in under 125 ms with under 5 MiB of overhead each.
| Service | Isolation | Notable |
|---|---|---|
| E2B | Firecracker microVM | pause and resume (files and memory), per-sandbox egress firewall |
| Modal Sandboxes | gVisor (a VM runtime optional) | snapshots, GPUs, up to 24 h |
| Daytona | dedicated kernel, filesystem and network | snapshots, volumes |
| Cloudflare Sandbox SDK | a microVM per instance | internet can be switched off; storage mounts |
| Vercel Sandbox | Firecracker microVM | credentials injected at the network boundary |
| Claude Managed Agents | a fresh Linux container per session | hosted harness; self-hosted sandboxes in beta |
| OpenAI Agents SDK sandbox agents | a layer over the providers above | resume from snapshots |
| Codex cloud | a container per task | internet off during the agent phase by default |
The pattern from class, for running many agents: a sandbox each, no real key inside (a proxy adds it, limits what can be called and counts it), a time limit and a budget on every run. That is how this class ran the week 1 trials and tested the week 2 harnesses.
Firecracker · each provider's docs, October 2026
9. Git worktrees
A worktree is a second working folder on its own branch, sharing one repository's history: two agents can't overwrite each other's files, and you compare and merge at the end. Worktrees isolate files, not processes, and don't prevent logical conflicts, so still split the work sensibly.
- Claude Code:
claude --worktree <name>works in.claude/worktrees/<name>;isolation: worktreegives a subagent a temporary one; a.worktreeincludefile copies gitignored files such as.env. - Codex app: choose "Worktree" for a new chat; "Handoff" moves work between a worktree and your checkout.