[BUG] Claude-Code Crashes on Basic Usage with EAGAIN Loop

Resolved 💬 11 comments Opened Sep 20, 2025 by map588 Closed Sep 26, 2025

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 crashes immediately with an infinite EAGAIN spawn loop when performing basic operations, making the tool completely unusable.

What Should Happen?

  • Claude-code should start normally
  • Basic commands should work
  • Tool should be usable for development tasks

Error Messages/Logs

EAGAIN: resource temporarily unavailable, posix_spawn '/opt/homebrew/bin/pgrep'
      path: "/opt/homebrew/bin/pgrep",
   syscall: "spawn pgrep",
     errno: -35,
 spawnargs: [ "-P", [some PID] ],
      code: "EAGAIN"
[... repeats indefinitely at high speed ...]

Steps to Reproduce

  1. Open terminal
  2. Run claude
  3. Try any basic operation:
  • Type any prompt
  • Run /doctor command
  • Run any slash command
  1. Observe immediate crash

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

1.0.109

Claude Code Version

1.0.120

Platform

Anthropic API

Operating System

macOS 26.0 build 25A354

Terminal/Shell

iTerm2.app

Additional Information

  • This is not a resource exhaustion issue - happens on fresh system
  • Affects basic usage - not edge cases or complex operations
  • Makes tool completely unusable - no functionality works
  • Requires debug flag to see error - without -d it just appears frozen

When another terminal instance is opened while this error is occuring:
[forkpty: Resource temporarily unavailable]
[Could not create a new process and open a pseudo-tty.]

Suggested Investigation

The error suggests claude-code is trying to use pgrep -P [PID] for process management during normal operation, but failing to handle the EAGAIN error properly. This appears to be a issue with the tool's process spawning logic, not a resource limitation.

View original on GitHub ↗

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