Session freezes with 100% CPU spin loop after idle/terminal switch

Resolved 💬 6 comments Opened Jan 26, 2026 by rasmusrbj Closed Jan 30, 2026

Description

Claude Code sessions occasionally freeze with the process spinning at 100% CPU. The session becomes unresponsive to input, and the debug log stops updating.

Steps to Reproduce

  1. Start Claude Code in a project directory (in my case ~/happenings)
  2. Send a message - it works initially
  3. Switch to another terminal/window for a while
  4. Switch back and try to send another message
  5. Session freezes - input is accepted but nothing happens

Observed Behavior

  • Process shows R+ state (running in foreground) with ~99% CPU usage
  • Debug log stops updating completely - no new entries when trying to send messages
  • Multiple TCP connections remain established but idle
  • Session does not recover - requires kill to terminate
PID STAT  %CPU %MEM ELAPSED COMMAND
32139 R+    99.4 11.7   03:25 claude

Expected Behavior

Session should remain responsive after idle periods and terminal switches.

Environment

  • Claude Code version: 2.1.19 (Homebrew cask)
  • OS: macOS Darwin 25.2.0
  • Platform: darwin (Apple Silicon)

Configuration

The project has:

  • 1 project-local MCP server (happenings-admin)
  • 7 global MCP servers (mix of local and remote mcp-remote servers)
  • 2 LSP plugins (gopls-lsp, swift-lsp)
  • 3 custom skills/commands

Additional Context

  • Fresh sessions in the same directory work fine initially
  • The freeze happens specifically after idle time + terminal focus change
  • Other Claude Code sessions (in different directories) continue working normally
  • This appears to be a UI/rendering loop issue rather than network-related, given the CPU spin

Workaround

Kill the frozen process and start a new session.

View original on GitHub ↗

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