[BUG] Claude-Code Crashes on Basic Usage with EAGAIN Loop
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
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
- Open terminal
- Run
claude - Try any basic operation:
- Type any prompt
- Run
/doctorcommand - Run any slash command
- 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
-dit 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.
11 Comments
workaround for me:
That uninstalls pgrep, pkill, and pfind. It also breaks bun. @takaokouji
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.
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.
???
profit
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-codeand 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 latestandclaude migrate-installerbefore, and the standard global install is working well, so it could have something to do with the local install. @takaokoujiOn 25/09/23 07:30PM, Matthew Prock wrote:
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.
On 25/09/25 09:27PM, Matthew Prock wrote:
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?
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.