CloudCodeTree LogoCloudCodeTree
AI NewsTutorialsAbout
CloudCodeTree Logo
CloudCodeTree
  • AI News
  • Tutorials
  • About
← Back to AI News
Start Receiving Tool Arguments Immediately: Enable eager_input_streaming on Large-Output Tools

Start Receiving Tool Arguments Immediately: Enable eager_input_streaming on Large-Output Tools

Chris Harper

2 min read

Aug 16, 2026 · 12:05 UTC

AI
Workflow
Agents
Best Practices

Add "eager_input_streaming": true to a tool definition and Claude streams partial JSON arguments to your client instantly — first-byte latency drops from ~15s to ~3s for large parameters.

By default, the Claude API buffers a tool's entire input JSON until it is valid before delivering it. For a write_file tool producing a 2,000-word document, that means 15+ seconds of silence before your UI sees anything. Fine-grained tool streaming, now GA on all models and platforms (no beta header needed), removes that buffer per tool.

One field, on the tool definition

import anthropic

client = anthropic.Anthropic()

tools = [{
    "name": "write_file",
    "description": "Write content to a file",
    "input_schema": {
        "type": "object",
        "properties": {
            "path": {"type": "string"},
            "content": {"type": "string", "description": "File content — can be thousands of words"}
        },
        "required": ["path", "content"]
    },
    "eager_input_streaming": True   # <- the only change
}]

with client.messages.stream(
    model="claude-sonnet-5-20260130",
    max_tokens=4096,
    tools=tools,
    messages=[{"role": "user", "content": "Write a thorough README for a Python CLI tool."}]
) as stream:
    for event in stream:
        if hasattr(event, "delta") and event.delta.type == "input_json_delta":
            # Partial JSON string — write to UI as it arrives
            print(event.delta.partial_json, end="", flush=True)

Three things to know before shipping

  1. User-defined tools only. eager_input_streaming cannot be set on built-in tools (web_search, code_execution, etc.).

  2. Partial JSON is not valid JSON. The SDK exposes a snapshot dict (partially parsed Python dict) on each delta — safe to read for real-time display. Wait for content_block_stop before passing the completed arguments to your actual tool executor.

  3. Different from Agent SDK streaming. include_partial_messages=True in the Claude Agent SDK (covered Aug 1) signals when a tool call starts and stops. eager_input_streaming is lower-level: it streams the actual argument content while Claude is generating it, before the tool call completes. Use both together for the fastest possible UI.

Sources: Fine-grained tool streaming — Claude Platform Docs · Streaming messages — Anthropic Docs