1:1 mentoring with Big Tech AI engineers
LLM & Agentic

Who Owns the Loop

Manual loop vs the SDK Tool Runner vs Managed Agents vs the Claude Agent SDK — separated by who supplies the agent harness and who supplies the deployment.

Last updated

Core7 min readFirst readThe Agent LoopTool Use with Claude

After this section you can

  • Place the manual loop, Tool Runner, Claude Agent SDK and Managed Agents on the harness and deployment axes
  • Tell the Tool Runner apart from the Claude Agent SDK and pick the right one for a task
  • Choose an option from a scenario, and explain why approval gates do not require a hand-written loop
26

Who Owns the Loop: Harness vs Deployment

There are four ways to build an agent on Claude. Two questions tell them apart, and the word “SDK” hides both of them.

Key idea

Ask two things: who runs the loop (the harness), and whose machine it runs on (the deployment). The Tool Runner and the Claude Agent SDK both give you a harness and leave hosting to you. Only Managed Agents takes both.

Two questions, four options: the Tool Runner and the Agent SDK sit in the same cell
HARNESS · WHO RUNS THE LOOP → you write the loop the loop is supplied DEPLOYMENT ↓ you host it your servers, your filesystem Anthropic hosts loop + sandbox per session 1 · Manual loop you write: the while stop_reason loop tools: only the ones you define anthropic · messages.create 2 · Tool Runner you write: tool functions tools: only yours anthropic (beta) 3 · Agent SDK you write: prompt + options tools: Claude Code’s own claude-agent-sdk empty cell none of the four options sits here 4 · Managed Agents (beta) you write: an agent config, plus results for your own tools Anthropic runs the loop and a sandbox per session 2 and 3 both give you a loop and leave hosting to you. They differ in tools, not in who runs them.

Related

More in LLM & Agentic

Get full access to all 74+ sections with code examples, diagrams, and interactive animations.

Unlock Premium