agentLoop property

AgentSdkAgentLoop? agentLoop
final

Claude Code's own agent loop, or null for none.

Null — what an app's actions and its document agent use — turns the SDK's own tools off and allows one turn, or tools and a bounded number of turns. Non-null hands the run to Claude Code with its own tools and MCP servers, under AgentSdkAgentLoop.permissionMode and AgentSdkAgentLoop.maxTurns: a backend that is itself an agent.

Implementation

final AgentSdkAgentLoop? agentLoop;