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

Status Fixed / completed
Maintainer reply None cached
Activity 11 comments · opened Sep 20, 2025 · 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 ↗

11 Comments

takaokouji · 11 months ago

workaround for me:

brew uninstall proctools
map588 · 11 months ago

That uninstalls pgrep, pkill, and pfind. It also breaks bun. @takaokouji

equwal · 11 months ago
uninstall the coreutils
I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux,” and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux.

Except, if you delete the bloat GNU/Linux utils, you can now finally run the lean and high-quality Claude Code code-base. Let's all delete GNU from our GNU/Linux systems and use simple utils like scc compiled sbase or musl compiled utils.

I noticed that the systemD and OpenRC among others use this "kill" command to kill processes. The problem is running software in the first place. If no software is running, kill is not needed.

equwal · 11 months ago

I'd just like to interject for a moment. You're referring to the notion of uninstalling the GNU core
utils as a way to trim down your operating system, but what you're really advocating for is not so
much a minimalist approach, as it is the abandonment of the very foundation of our free and open
systems.

These GNU utilities, often dismissed as "bloat," are in fact the essential building blocks that make
a functioning operating system. They provide the shell, the file system management tools, the
networking capabilities, and more - all the things that allow us to interact with our computers in a
meaningful way. Without these GNU utilities, your Claude Code code-base would be little more than an
isolated kernel, unable to serve any purpose.

You may say, "But what about scc compiled sbase or musl compiled utils?" Ah, yes, those are indeed
lean and efficient alternatives, but they too are built on the foundation of the GNU utilities. The
fact that you can use them in place of the original GNU tools does not diminish the importance of the
GNU Project's work.

And as for your observation about systemD and OpenRC using the "kill" command - yes, it is true that
process management is a necessary part of any operating system. But this is precisely why we need
robust and reliable utilities like those provided by GNU, rather than some half-baked minimalist
approach.

Let us not forget that the GNU Project has been working tirelessly for decades to create free and open software that serves
the needs of all computer users, not just a select few who prefer a Spartan computing experience. Let us celebrate the
richness and diversity of our free software ecosystem, rather than seeking to tear it down in the name of austerity.

I'd just like to interject for a moment. You're referring to the notion of uninstalling the GNU core
utils as a way to trim down your operating system, but what you're really advocating for is not so
much a minimalist approach, as it is the abandonment of the very foundation of our free and open
systems.

These GNU utilities, often dismissed as "bloat," are in fact the essential building blocks that make
a functioning operating system. They provide the shell, the file system management tools, the
networking capabilities, and more - all the things that allow us to interact with our computers in a
meaningful way. Without these GNU utilities, your Claude Code code-base would be little more than an
isolated kernel, unable to serve any purpose.

You may say, "But what about scc compiled sbase or musl compiled utils?" Ah, yes, those are indeed
lean and efficient alternatives, but they too are built on the foundation of the GNU utilities. The
fact that you can use them in place of the original GNU tools does not diminish the importance of the
GNU Project's work.

And as for your observation about systemD and OpenRC using the "kill" command - yes, it is true that
process management is a necessary part of any operating system. But this is precisely why we need
robust and reliable utilities like those provided by GNU, rather than some half-baked minimalist
approach.

Let us not forget that the GNU Project has been working tirelessly for decades to create free and open software that serves
the needs of all computer users, not just a select few who prefer a Spartan computing experience. Let us celebrate the
richness and diversity of our free software ecosystem, rather than seeking to tear it down in the name of austerity.

equwal · 11 months ago
cd fakepath
ln -s /usr/bin/false pgrep
alias claude='PATH=PATH:/path/to/fakepath/pgrep claude'

???
profit

map588 · 11 months ago

Okay, my workaround was pretty simple, I just removed everything related to claude-code, including configs, state and share directories, and then just reinstalled with npm install -g @anthropic-ai/claude-code and now it works.

I lost all my cached todo's and project files held by claude, but I wasn't able to use it for around 2 weeks so I considered it a worthy tradeoff. Its probably not necessary to delete everything, but a clean install is a clean install.

Another note, I used claude install latest and claude migrate-installer before, and the standard global install is working well, so it could have something to do with the local install. @takaokouji

equwal · 11 months ago

On 25/09/23 07:30PM, Matthew Prock wrote:

map588 left a comment (anthropics/claude-code#7923) Okay, my workaround was pretty simple, I just removed everything related to claude-code, including configs, state and share directories, and then just reinstalled with npm install -g @anthropic-ai/claude-code and now it works.

well, which version/pm were you using then

Also, that Works On My Machine too and is how I've been using it for a
day or two.
--
CAEE B377 FC82 BAF9 102C D22F C5CE D003 1AA8 E281
Spenser Truex https://equwal.com

map588 · 11 months ago
On 25/09/23 07:30PM, Matthew Prock wrote: map588 left a comment (anthropics/claude-code#7923) Okay, my workaround was pretty simple, I just removed everything related to claude-code, including configs, state and share directories, and then just reinstalled with npm install -g @anthropic-ai/claude-code and now it works. well, which version/pm were you using then Also, that Works On My Machine too and is how I've been using it for a day or two. -- CAEE B377 FC82 BAF9 102C D22F C5CE D003 1AA8 E281 Spenser Truex https://equwal.com

It looks like it was updated to version 1.0.123 from 1.0.120.

Maybe the issue was resolved, maybe my local files were throwing it off (I had SuperClaude then installed spec-kit, which both introduce slash commands, proompts, and other modifications to the config directory).

At this point I don't know, I don't like digging at minified javascript, it now works, and I don't care why.

equwal · 11 months ago

On 25/09/25 09:27PM, Matthew Prock wrote:

Closed #7923 as completed.

I mean, it's not completed. There is a crazy bug.
--
CAEE B377 FC82 BAF9 102C D22F C5CE D003 1AA8 E281
Spenser Truex https://equwal.com

map588 · 11 months ago
On 25/09/25 09:27PM, Matthew Prock wrote: Closed #7923 as completed. I mean, it's not completed. There is a crazy bug. -- CAEE B377 FC82 BAF9 102C D22F C5CE D003 1AA8 E281 Spenser Truex https://equwal.com

Its node, what do you expect, stability?

github-actions[bot] · 11 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.