[BUG] Haiku agents fail with "tool_reference blocks not supported" error despite Haiku supporting standard tool calling

Resolved 💬 5 comments Opened Dec 20, 2025 by rickyklopper Closed Feb 14, 2026

Description

Claude Code is sending tool_reference blocks to Haiku subagents, causing them to fail with an API error. Haiku models fully support standard tool calling but do not support the advanced "tool search" feature that uses tool_reference blocks. Claude Code should detect when spawning Haiku agents and use standard tool calling instead of the tool search feature.

Error Message

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"'claude-haiku-4-5-20251001' does not support tool_reference blocks. This feature is only available on Claude Sonnet 4+, Opus 4+, and newer models."},"request_id":"req_011CWHpmGez4kdzkoXscB8q4"}

Steps to Reproduce

  1. Create a custom agent with model: haiku in frontmatter:

``yaml
---
name: assess
description: Assesses task complexity
tools: Read, Grep, Glob, Bash
model: haiku
---
``

  1. Invoke the agent (e.g., through TaskMaster workflow or direct agent call)
  1. Observe the 400 error when Claude Code attempts to spawn the Haiku subagent

Expected Behavior

  • Haiku agents should successfully receive and use tools via standard tool calling
  • Claude Code should detect the model type and choose the appropriate tool calling method:
  • Sonnet 4+/Opus 4+: Use tool search with tool_reference blocks (advanced feature)
  • Haiku: Use standard tool calling without defer_loading or tool_reference blocks

Actual Behavior

  • Claude Code sends tool_reference blocks to Haiku agents regardless of model type
  • Anthropic API rejects the request with 400 error
  • Haiku agents cannot function despite supporting standard tool use

Environment

  • Claude Code Version: 2.0.73
  • Operating System: macOS (Darwin 25.1.0)
  • Model: claude-haiku-4-5-20251001
  • Agent Configuration: Custom agents with model: haiku in frontmatter

Timeline

  • Before Dec 19, 2025: Haiku agents worked correctly
  • Dec 18, 2025: Claude Code 2.0.73 released
  • Dec 19, 2025 07:03: Updated to 2.0.73 (symlink timestamp)
  • Dec 20, 2025: Issue started occurring

This suggests the issue was introduced in version 2.0.73 or the user updated from an older version that didn't use the tool search feature.

Technical Details

According to Anthropic's official documentation:

Tool Search Feature (uses tool_reference blocks):

Standard Tool Calling (no tool_reference blocks):

  • Supported: All Claude models including Haiku
  • No beta header required
  • How it works: Tools sent directly in request, no defer_loading

Root Cause

Claude Code appears to be using the tool search feature (with defer_loading: true and tool_reference blocks) universally when spawning subagents, without checking if the target model supports this feature.

Proposed Solution

Claude Code should implement model-aware tool calling:

def get_tool_calling_method(model_name: str):
    # Models supporting tool search
    if model_name.startswith(('claude-sonnet-4', 'claude-opus-4')):
        return 'tool_search'  # Use defer_loading + tool_reference blocks
    else:
        return 'standard'     # Use standard tool calling (no defer_loading)

Workaround

Temporarily change Haiku agents to use Sonnet:

model: sonnet  # or model: opus

This increases costs but allows agents to function until the bug is fixed.

Additional Context

  • The tool search feature is a performance optimization for large tool catalogs (10+ tools)
  • It's completely optional - standard tool calling works for all use cases
  • Haiku benefits from its speed and cost-efficiency, making it ideal for simple assessment/research agents
  • This bug forces users to use more expensive models unnecessarily

Impact

  • High: Breaks all custom Haiku agents
  • Workaround exists: Switch to Sonnet/Opus (but increases costs)
  • Affects: Any Claude Code user with custom Haiku agents in .claude/agents/

References

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗