Claude Code enters unrecoverable CPU spin after MCP tool response

Resolved 💬 8 comments Opened Mar 20, 2026 by synman Closed May 30, 2026

Bug Description

Claude Code enters an unrecoverable 100% CPU spin after receiving a normal MCP tool response. The process becomes completely unresponsive — Ctrl-C, Esc, and all input are ignored. Only kill -9 terminates it. Zombie child processes are left unreaped.

Environment

  • Claude Code version: Latest (installed via claude update on 2026-03-19)
  • OS: macOS (Apple Silicon, Darwin 25.3.0)
  • Shell: zsh
  • Model: claude-opus-4-6 (1M context)

Reproduction

  1. Start a Claude Code session with a custom MCP server providing tools
  2. During conversation, invoke an MCP tool that returns a well-formed JSON response (~2758 bytes, ~4 objects)
  3. The MCP tool completes successfully and returns data to Claude Code
  4. Claude Code enters CPU spin instead of generating the assistant response

Specific trigger observed: report_proposals(filter="read") MCP call returned 2758 chars of valid JSON (4 proposal objects). The tool result was received successfully but the runtime never generated a response.

Observed Behavior

  • Duration: ~11.5 hours of sustained 100% CPU before manual kill (started 12:47 AM, killed 12:09 PM EDT on 2026-03-20)
  • Process state: R+ (running, foreground) — pure CPU spin, not I/O blocked
  • Input: Ctrl-C and Esc completely non-responsive
  • Session ID: 6b7a00f4-8d44-4adc-8e22-495502c64cbe
  • Zombie children: Two child processes (node workers) were never reaped after parent was killed

Expected Behavior

Claude Code should either:

  1. Generate a response after receiving the MCP tool result, or
  2. Time out and surface an error to the user, or
  3. Remain responsive to Ctrl-C/Esc for graceful termination

Additional Context

  • The MCP response was well-formed JSON, not truncated or malformed
  • This is not the first hang observed — Agent subagent calls have also hung with no timeout/recovery mechanism
  • No custom hooks or scripts were executing at the time — the hang occurred in the Claude Code runtime itself during response generation
  • The session transcript (JSONL) shows the MCP tool result was the last entry before the hang

Impact

  • 11.5 hours of wasted compute
  • Required manual process investigation and kill -9
  • Zombie processes left on system requiring cleanup
  • No built-in detection, timeout, or recovery mechanism exists in Claude Code

View original on GitHub ↗

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