Skip to content
Flows
Tier 1 · Claude Code internals Claude Code internals · fetched 2026-07-08

Deep Dive: Agent Orchestration Patterns

Follows a dispatched agent through its full lifecycle - foreground vs background execution, auto-backgrounding of long tasks, sidechain transcripts for resume, layered tool filtering, and result handoff - then catalogs six reusable orchestration patterns: worker pool, pipeline, supervisor-worker, adversarial verification, fork-join, and resume chain. The adversarial verification agent, which must run real commands and issue a PASS/FAIL verdict while being forbidden from editing the project, gets special attention as a defense against LLM self-verification failure modes.

View source on GitHub

Key takeaways

  • 01

    Never trust an implementer's self-verification: a separate read-only agent must build, test, and probe adversarially

  • 02

    Re-inject critical constraints every turn - long conversations make agents forget their rules

  • 03

    Layer tool filtering: global denylist, per-agent-type restrictions, then per-instance allowances

  • 04

    Every agent creation needs matching cleanup - eight resource types released in one finally block

  • 05

    Explicit communication beats assumption: teammates are told exactly which tool makes messages visible

  • 06

    Token economy is architectural: read-only scouts skip project docs and run on cheaper models

Flows built on this research