[BUG] 100% CPU usage for ~5 minutes on startup due to 64 parallel TCP connections

Resolved 💬 5 comments Opened Dec 11, 2025 by fabianmarian8 Closed Feb 11, 2026

Description

Claude Code consistently uses 100% CPU for approximately 5 minutes after startup, then spontaneously stabilizes. This happens on every launch regardless of version (tested 2.0.51 and 2.0.53).

Root Cause Analysis

Through detailed investigation, we identified that:

  1. 64 parallel TCP connections are opened to Anthropic API (160.79.104.10:443) immediately on startup
  2. One thread runs at 100% CPU while all other threads (main, Bun Pool, Heap Helper, JavaScriptCore) sleep normally
  3. After ~5 minutes, connections drop to ~5 and CPU normalizes

Evidence

New process (high CPU):

PID: 54887 CPU: 100.3% Uptime: 1:14
TCP connections: 64 (all to 160.79.104.10:https)

Stabilized process (normal):

PID: 44042 CPU: 7.3% Uptime: 6:53
TCP connections: 5

Thread breakdown during 100% CPU state:

Thread 1-8:  0.0% CPU (Sleeping)
Thread 9:   100.0% CPU (Running) ← Problem thread
Thread 10-12: 0.0% CPU (Sleeping)

Network traffic per connection:

Each of the 64 connections transfers ~4KB data (appears to be handshake/polling):

tcp4 192.168.1.104:62773<->160.79.104.10:443,4117,2084
tcp4 192.168.1.104:62772<->160.79.104.10:443,4141,2048
... (64 total)

What was tested (none helped):

  • [x] Downgrade from 2.0.53 to 2.0.51
  • [x] Clearing ~/.claude/shell-snapshots/ (181 files, 24MB)
  • [x] Clearing ~/.cache/chrome-devtools-mcp/
  • [x] BUN_CONFIG_MAX_HTTP_REQUESTS=8
  • [x] Running without --dangerously-skip-permissions flag
  • [x] Killing zombie shell processes

Environment

  • OS: macOS 26.1 (Darwin 25.1.0)
  • Architecture: ARM64 (Apple Silicon)
  • Claude Code versions: 2.0.51, 2.0.53
  • MCP servers: 6 configured (bazos, chrome-devtools, filesystem, github, gsc, vercel)

Steps to Reproduce

  1. Open a new terminal
  2. Run claude (with or without flags)
  3. Immediately check CPU: ps aux | grep claude
  4. Observe 100% CPU for ~5 minutes
  5. Check TCP connections: lsof -p <PID> | grep ESTABLISHED | wc -l → shows 64

Expected Behavior

  • CPU usage should be near 0% when idle
  • Connection pool should be limited (not 64 parallel connections)

Workaround

Wait ~5 minutes after startup before using Claude Code.

Suggested Fix

The HTTP connection pool appears to have no limit (Agent.defaultMaxSockets = Infinity found in binary). Consider:

  1. Limiting max concurrent connections (e.g., 8-16)
  2. Using HTTP/2 multiplexing instead of multiple connections
  3. Lazy connection establishment instead of eager pool warmup

View original on GitHub ↗

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