Follow Discord
Sweep 22 Oct 2026 · 21:04Z Build v2.1.309 528 read Stable v2.1.308 Latest v2.1.309 Next v2.1.309 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.0.32 ·

Automated Tool Execution API (BetaToolRunner)

Entry
JSON All of v2.0.32
EntryKind: in v2.0.32,
ChangesSection of the release

What: A new toolRunner() method in the Messages API that automatically executes tools in an agentic loop, eliminating the need to manually handle tool_use/tool_result message cycles.

How to use:

const runner = client.beta.messages.toolRunner({
  model: "claude-sonnet-4-20250514",
  max_tokens: 1024,
  max_iterations: 10, // Limit agentic loops
  tools: [
    {
      name: "get_weather",
      run: async (input) => {
        // Your tool implementation
        return "Sunny, 72°F";
      }
    }
  ],
  messages: [{ role: "user", content: "What's the weather?" }]
});

// Stream each iteration
for await (const messageStream of runner) {
  // Handle streaming response
}

// Or wait for completion
const finalMessage = await runner.done();

Details:

  • Automatically detects tool_use blocks in assistant responses and executes matching tools
  • Supports both streaming and non-streaming modes
  • Configurable iteration limits via max_iterations parameter
  • Tools must implement a run() method that returns results
  • Optional parse() method for input validation/transformation
  • Returns properly formatted tool_result messages with error handling
  • Can be controlled manually via generateToolResponse() and pushMessages() methods
  • Evidence: Class TYA at line 82603, function bh9() at line 82564, variable uZ1 at line 82604, new toolRunner() method at line 82828

See this entry in the whole of v2.0.32 →

Feedback