[BUG] CLI renderer crashes on `tool_search_tool_regex` / `tool_search_tool_result` blocks with "Unable to render"

Open 💬 0 comments Opened Jul 15, 2026 by LiveNathan

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

During normal streaming (not /compact), Claude Code 2.1.210 crashes when the API sends tool_search_tool_regex and tool_search_tool_result message blocks. The CLI emits repeated Unable to render server tool block and Unable to render message type errors, followed by cascading 502 SSE buffer errors (Unable to safely convert buffered response to SSE). The session becomes effectively unusable until the stream retries or the user cancels.

This happens when using Sonnet 5 with 144 deferred MCP tools. The tool search mechanism triggers correctly, but the local CLI renderer does not have a handler for these new message types, causing the render pipeline to fail.

What Should Happen?

Claude Code should silently handle or render tool_search_tool_regex and tool_search_tool_result blocks without crashing the stream renderer. If the blocks are internal implementation details, they should be parsed and stripped before reaching the terminal UI, similar to how other internal tool-use metadata is handled.

Error Messages/Logs

Unable to render server tool block: server_tool_use (tool_search_tool_regex)
Unable to render message type: tool_search_tool_result
...
API error (attempt 1/11): 502 502 event: error
data: {"type": "error", "error": {"type": "api_error", "message": "Unable to safely convert buffered response to SSE."}}


Full debug log available on request. The errors occur in `/src/entrypoints/cli.js` at the renderer layer (`k9s`, `es`, `Ma`, `yS`, `lpe`, `sIe`, `HD`, `vSe`, `Lt`, `Qe` in the minified stack).

Steps to Reproduce

  1. Configure multiple MCP servers so that deferred tool count exceeds ~100 (mine: 144 deferred tools across proophboard, idea, HubSpotDev, claude.ai context7, asana, sentry, notebooklm, slite, graphify).
  2. Start Claude Code with claude --debug.
  3. Ensure model is Sonnet 5 (/model → claude-sonnet-5). Haiku 4.5 lacks ToolSearchTool support entirely.
  4. Ask a question that requires an MCP tool (e.g., "list my proophboard workspaces" or any query that triggers tool discovery).
  5. Observe in debug output: Dynamic tool loading: 0/144 deferred tools included → the API begins sending tool search blocks.
  6. Stream starts, then CLI emits repeated Unable to render server tool block and Unable to render message type errors.
  7. Within ~10 seconds, the stream aborts with Unable to safely convert buffered response to SSE (502).

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.210

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Terminal/Shell: Ghostty 1.3.2

  • Related to #39374 and #39450, but this is a distinct bug. Those issues were /compact 400s caused by the API rejecting tool_search_tool_regex names. This issue is a live stream renderer failure where the CLI itself cannot parse/render these blocks.
  • The issue is 100% reproducible in my environment with 144 deferred tools.
  • Reducing deferred tool count below the threshold avoids the issue entirely.
  • Ponytail plugin was initially suspected but ruled out — the hook fires cleanly and outputs OK. Disabling Ponytail does not prevent the rendering errors.
  • I can provide the full --debug log on request.

View original on GitHub ↗