← ~/pillars / multi-agent-orchestration / guide

Architecture and orchestration

When splitting work across agents pays, which topology fits which job, how the patterns port across Claude subagents, LangGraph, ADK, and the OpenAI Agents SDK, and the system design that lets an agent safely change the part it is given.

updated 2026-11-08 ~3 min read

← back to multi-agent-orchestration/

on this page

One agent with a tool loop solves most problems, and Anthropic’s own patterns guidance says exactly that: start simple, add multi-agent structure only when it measurably helps (Building effective agents). This pillar is about the cases where it does help, and the documented rule for telling them apart, because the failure mode of getting it wrong is not subtle. It is burned tokens, coordination overhead, and two agents silently overwriting each other’s edits.

The underlying reason orchestration matters at all is the context window. Claude Code’s best practices open with the constraint: the window fills fast, and performance degrades as it fills (best practices). A subagent gets a fresh window, does the noisy exploration there, and returns only a summary. Orchestration is context management before it is parallelism.

The decision rule

The documented rule, condensed from the best practices and agent teams docs:

TopologyPays whenBurns when
Subagent investigationResearch that reads many files; keeps the main context cleanTasks that share state or need sequential ordering
Agent team (parallel domains)Cross-layer changes; parallel code review by domainSame-file edits; tasks with dependency chains
Fan-out via claude -p loopLarge migrations across N independent filesTasks requiring coordination between invocations

The agent teams documentation is blunt about the cost side: teams “add coordination overhead and use significantly more tokens than a single session”, and for sequential tasks, same-file edits, or work with many dependencies, a single session or subagents are more effective. The practical ceiling it gives is 3–5 teammates before overhead outweighs gains: a 15-task job maps to roughly three workers with 5–6 tasks each.

So the test before fanning out: are the subtasks genuinely independent, with no shared files, no ordering, no mid-task coordination? If yes, parallelism buys wall-clock time and context isolation. If no, you are paying token overhead to recreate the coordination a single session gives you for free.

Architecture for agents

Orchestration decides how work is split; architecture decides whether each agent can understand and safely change the part it is given. Agent-native architecture covers boundaries, local emulation and the greenfield question, and designing for agent operations covers runbooks as skills, investigate-then-remediate operations and the telemetry agents can query.

Applied to Java on AWS

The orchestration story has a gap Java teams hit immediately: the Claude Agent SDK (the “Claude Code agent loop as a library” surface) ships for Python and TypeScript only (Agent SDK overview, checked 2026-06-10). There is no Java Agent SDK from Anthropic. (Google’s ADK does ship Java support. The framework landscape page weighs it.) Within the Claude toolchain, Java teams have two documented paths:

  1. Managed Agents API. A REST surface where the agent runs in an Anthropic-managed sandbox with Anthropic-hosted session state, rather than in your process, positioned in the SDK docs’ own comparison table as the choice for production agents without sandbox and session infrastructure. REST is callable from any JVM service, which makes this the correct surface for orchestration embedded in Java applications.
  2. Headless CLI. Shell-exec claude -p from a Java process (or CI job) for one-shot tasks and fan-out loops. This is the documented shape for large migrations across independent files, and it is what our fan-out review workflow uses.

On authentication, the SDK and CLI run against Amazon Bedrock with CLAUDE_CODE_USE_BEDROCK=1, or Claude Platform on AWS with CLAUDE_CODE_USE_ANTHROPIC_AWS=1 (Agent SDK overview), so the headless path needs no Anthropic-direct credentials in an AWS-credentialled environment. Pass --permission-mode on every headless call: from v2.1.285 a claude -p or Agent SDK session on Bedrock starts in auto mode when nothing sets one, where the same call against the Anthropic API starts in default (permission modes docs; the permission policy page has the detail).

One stability note that shapes every recommendation in this pillar: in-session subagents are a stable, documented feature; agent teams are experimental: disabled by default behind CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, with known limitations (agent teams). Build your team’s standard workflows on subagents and headless fan-out; treat teams as a preview of the peer-to-peer topology.

// sources