[BUG] Haiku agents fail with "tool_reference blocks not supported" error despite Haiku supporting standard tool calling
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
- Create a custom agent with
model: haikuin frontmatter:
``yaml``
---
name: assess
description: Assesses task complexity
tools: Read, Grep, Glob, Bash
model: haiku
---
- Invoke the agent (e.g., through TaskMaster workflow or direct agent call)
- 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_referenceblocks (advanced feature) - Haiku: Use standard tool calling without
defer_loadingortool_referenceblocks
Actual Behavior
- Claude Code sends
tool_referenceblocks 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: haikuin 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):
- Supported models: Claude Sonnet 4+, Opus 4+ only
- NOT supported: Haiku (any version)
- Requires: Beta header
advanced-tool-use-2025-11-20 - Launched: November 24, 2025
- Documentation: https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool
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
- Tool Search Documentation: https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool
- Supported Models Table: Shows Sonnet 4.5 and Opus 4.5 only, no Haiku
- API Release Notes (Dec 19, 2025): https://platform.claude.com/docs/en/release-notes/api
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗