Skip to specification

Orchestration

How work moves: lifecycle hooks, retries, approval gates, heartbeats, human handoff. The layer where agent work looks less like chat and more like a runtime.

Orchestration is the harness deciding how work moves. Lifecycle hooks, heartbeats, retries, approval gates, human handoff, wrapping tool calls, ordering steps, routing between models — the busy machinery that carries a workflow from start to finish.

session startload instructions,memory, planbefore toolhook: validate,block, rewritetool callruns in theexec environmenton failurehook: retry,backoff, replanapproval gatehuman answersthe risky stepdoneverify, record,checkpointthe model isn't doing this by willpower — the harness carries the workflow
Hooks and gates along a single run. Before a tool call, do this; after a failure, do that.

Less like chat, more like a runtime

Every rule of the form "before X, do this; after Y, do that" lives here:

  • Before a tool call — validate it, rewrite it, or block it outright
  • After a failure — retry with backoff, replan, or escalate
  • Before the risky step — stop and ask the human
  • On a schedule — heartbeats that keep long work alive and detect stalls

This is the layer where agent work stops looking like a conversation and starts looking like a runtime. The model is not doing any of this by willpower — the harness is carrying the workflow, and the model gets to spend its attention on reasoning.

In the wild

Claude Code hooks are a textbook example: user-defined commands that fire on lifecycle events like pre-tool-use and post-tool-use, able to block, allow, or annotate the action. Agent frameworks expose the same idea as lifecycle events and middleware. Approval gates — "this command needs your yes" — are orchestration too, as is the heartbeat pattern popularized by projects like OpenClaw.

One agent, one attention stream

Orchestration lets a single agent do far more — but that agent still has one attention stream. Mid-task, you often want someone to go research a library, explore a repository, review a diff, verify a browser rendered correctly. If one agent does all of that serially, two things go wrong:

  1. It's slow — everything happens one after another
  2. The context gets crowded — every side quest dumps its findings into the same window that's trying to hold the main task

When work branches, the harness needs to branch too.