[BUG] Claude Code 2.1.138 becomes hot parent process and accumulates hundreds of zombie children on macOS

Resolved 💬 2 comments Opened May 11, 2026 by 64kramsystem Closed May 11, 2026

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?

Claude Code appears to enter a runaway child-process state on macOS. During the incident, the main Claude process was consuming about one full CPU core and had hundreds of zombie <defunct> child processes
parented to it. The macOS session previously became unable to fork/exec new processes; running Claude under a lower process limit prevented a full system crash, but exposed the stuck Claude parent and
zombie buildup.

Environment

  • Claude Code: 2.1.138
  • macOS: 26.3.1 (25D2128)
  • Shell wrapper limit used for this run: ulimit -u 900
  • System limits at start:
  • kern.maxproc=6000
  • kern.maxprocperuid=4000
  • kern.num_taskthreads=6144
  • kern.num_threads=30720

Observed Incident

Claude was launched at:

  • 2026-05-11T11:44:58+0300
  • Claude version: 2.1.138 (Claude Code)
  • wrapper PID: 92754
  • Claude later observed as PID 92778
  • Claude parent later became launchd [1]
  • Claude remained in process group 92754

At investigation time, ps showed:

92778     1 92754 R    R    <user>  ~55m  ~100% CPU  claude

Zombie count:

zombies_total 486
zombie_parent 92778 486

A process snapshot captured:

total_procs: 1208
user_procs: 908
zombies: 487 (user: 487)
top_user_parents:
  487 92778 claude

A 2-second sample of PID 92778 identified the process as Claude Code 2.1.138, parent launchd [1], launched at 2026-05-11 11:44:58.565 +0300. The sample also caught posix_spawn activity inside the hot Claude
process.

What Should Happen?

Claude should reap child processes and should not accumulate zombie children. If a background task fails or loops, it should terminate cleanly or surface an error without exhausting process resources.

Claude became a hot long-running parent process and accumulated roughly 486-494 zombie child processes. In earlier occurrences, the system eventually hit fork/exec failure, causing shells/new GUI apps to
fail until reboot.

Steps to Reproduce

Prompt Claude with something like:

In this repo, launch a background code-review/investigation by invoking codex from the shell, keep monitoring it while you continue inspecting files with shell commands. Do not edit files.

In another terminal, monitor:

while sleep 5; do
  date
  ps -axo pid=,ppid=,state=,stat=,etime=,%cpu=,command= \
    | awk '$3 ~ /Z/ || tolower($0) ~ /claude|codex/ { print }'
done

Failure signature:

  • claude ~100% CPU
  • many defunct children
  • zombie_parent CLAUDE_PID hundreds

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.138

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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