[BUG] MaxListenersExceededWarning
Resolved 💬 93 comments Opened Jun 24, 2025 by JohnDotOwl Closed Aug 23, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator)
responded on this thread — see the highlighted reply below.
(node:2760906) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)
This warning appears at random when using claude on terminal.
93 Comments
Same here. Happened with the most recent update.
Getting the same error.
Same here
same
getting the same error too : (node:93282) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
Hey, we're looking into this. Can you share when this started? Was it with today's release (1.0.33) or before? Also, what version of node are you running (
node -v)?Today, about 4-5hrs ago for me
got this as well
Does this happen at any time or just in plan mode?
anytime, usually after about 30 minutes of usage, it starts happening
node version is v20.18.1 here. It started with claude 1.0.33 afaiu.
1.0.31
31 is ok i think, didnt see this problem yesterday. I started when update started streaming into my terminals i had like quite a few open
my node is v22.14.0
so it's probably 1.0.32 , i started my session at 7am (+8time zone)
(node:2587029) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. Use events.setMaxListeners() to increase limit
Got several today. None before today.
Same here.
node v20.19.3 here; saw this first in claude 1.0.33
Same here
(node:25217) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. Use events.setMaxListeners() to increase limit~$ claude --version
1.0.33 (Claude Code)
~$ node --version
v18.19.1
same. started after today's update.
I started seeing this this morning
-Now let me check how this component gets its data by looking for the component class or service provider:
(node:839800) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
Same problem after today's update.
same here
same here
Same
Same here. It might be either a bug in claude code or claude code should properly set the max listeners value
Got this after a few minutes on latest update as well
same here too brothers
Started with today's release
yes, also getting this.
So what's the deal, what is the effect of having this error?
@ashwin-ant , if claude code came with a context engine like augmentcode's , maybe this error could have been solved. Just joking 😂
Any planned context engine for claude code?
What's the rest of you using ?
https://github.com/oraios/serena ?
Same here
(node:39739) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. Use events.setMaxListeners() to increase limit
Same. Started yesterday. (node:30263) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
same here
1.0.33 (Claude Code)
v20.9.0 (node)
❯ node -v
v20.19.3
❯ claude --version
1.0.33 (Claude Code)
add me lol
same here dawgs
same here
I made a downgrade to:
sudo npm install -g @anthropic-ai/claude-code@1.0.31
Getting this consistently with the new update as well.
Ditto
Another "Me Too".
Claude 1.0.33 and node 20.19.0
I get it within a couple of mins of use (ie, I don't need to have created a large context to start getting it).
I've noticed it in all modes
We've identified the root cause here and should have a fix up shortly.
I see there's a fix in progress, just chiming in that I started to see this error starting yesterday too.
(node:4361) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. Use events.setMaxListeners() to increase limit
This should be fixed in 1.0.34. Please update and let me know if it's still happening.
@ashwin-ant
Still happening in 1.0.34 for me.
@ChaseIngersol can you run these commands and paste the output:
@ashwin-ant
Absolutely. Thanks for your work on this awesome tool 👍
Also on node v21.1.0
I believe it's resolved. If you face any issue please comment. Thank you!
Still seeing this on 1.0.34
● Update Todos
⎿ ☐ Search for rate limiting related files in the codebase
☐ Analyze rate limiting implementation details
☐ Summarize how rate limiting works in this project
(node:575768) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
(Use
node --trace-warnings ...to show where the warning was created)● Task(Search for rate limiting code)
⎿ Done (18 tool uses · 0 tokens · 2m 44.1s)
claude -v1.0.34 (Claude Code)
node -vv18.17.1
Continuing to investigate here, thanks everyone for the reports 😄
@ducnvu @ChaseIngersol @weisisheng is it still happening as frequently? And is it happening early on in the session or after you've been in it for a while?
@ashwin-ant I have seen both off the top of my head. Recently upgraded from 1.0.27 to 1.0.34 and immediately noticed this, pretty frequent albeit it doesn't stop my run, just an extra warning on the screen
This appears to have been due to a bug in the upstream SDK, which is now resolved: https://github.com/anthropics/anthropic-sdk-typescript/commit/eb272af39becf87549859f7257ec272facf590b2.
We just rolled out 1.0.35 which incorporates this update. Please let me know if the issue arises on 1.0.35!
@ashwin-ant
Thanks for the update!
I haven't seen the issue so far on 1.0.35 after a full day of use, so we're looking good so far 👍
Closed. Thanks for the fix. I no longer see the error for the past 50m tokens.
@ashwin-ant I am still getting this error for 1.0.35 version: "(node:11555) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit"
claude -v
1.0.35 (Claude Code)
node -v
v20.19.2
@ashwin-ant I'm on 1.0.43 and still getting this issue:
@tmchow is it happening after a long chain of tool calls from a Task? Or just randomly?
Oh its back , saw it 2 minutes ago
Perfect! I found the issue. Now let me check the database to understand the actual source
mapping and see what xxx
(node:249303) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
(Use
node --trace-warnings ...to show where the warning was created)Happened after /compact , long conversation before /compact
1.0.43 (Claude Code)
I've discovered that this issue can occur even with minimal EventEmitter usage, not just during long conversations. Here's a minimal reproduction case that triggers the warning:
This suggests the issue might be more fundamental than just long conversations or
/compactcommands. The warning appears to be triggered by Claude Code's internal event handling, even when user code has minimal EventEmitter usage.Environment:
The workaround of increasing
defaultMaxListenersstill works:@ras434 I'm not following how a separate script would cause this warning in Claude Code. That script would run as its own node process. That said, we're looking back into this. It seems like the previous fix reduced the issue significantly (just based on this issue's comment volume), but there's clearly still something going on here.
I've seen it both ways but mostly after long chain
@ashwin-ant I've found a reliable way to reproduce the MaxListenersExceededWarning - it occurs consistently when spawning multiple parallel Task agents.
Reproduction Steps:
Example prompt that triggers it:
"Can you start 8 parallel agents to perform different tasks like reading files, creating files, and running bash commands?"
Key Observations:
/compactcommand neededTheory:
Each Task agent appears to register multiple abort listeners internally. When spawning several agents in parallel, these listeners accumulate quickly and exceed the default limit of 10, triggering the warning.
This would explain why:
/compacttriggers it (likely uses internal agents)The common factor is multiple internal operations that each register abort listeners without proper cleanup.
Fix coming in the next release.
I just started getting this today on Claude Code
1.0.51:claudespikes to 100% CPU and I see dozens and dozens ofrubyprocesses. Theclaudeprocess becomes unresponsive until Ikillall -9 claude.<img width="3680" height="2382" alt="Image" src="https://github.com/user-attachments/assets/507392ff-78ea-4614-9ac4-9bd8c37421ff" />
I'm curious about the processes being
rubybecause I don't think claude code has any ruby in it—the project I'm working on is a Ruby on Rails web app.Oh, hah, found my problem: for some reason there were a million hooks for formatting my code in
settings.local.json:<img width="1976" height="2826" alt="Image" src="https://github.com/user-attachments/assets/b1247d0d-09dc-4960-a184-b1784b24cd00" />
I had tools defined in
.claude/settings.jsonand it looks like they got copied over intosettings.local.jsonmultiple times?@christiangenco that sounds like it might be a separate bug with settings. Mind filing a new issue for that?
I'm closing this issue since I haven't heard any new reports in the last week (fix went out in 1.0.44).
I just got this again today. I've been getting it for a while. I think it might have to do with subagents? Not sure. I have never seen it if I'm running all tasks in the "root" agent. I'm running on Mac OS and have auto-update enabled.
claude -vyields1.0.52 (Claude Code)@ashwin-ant Is it possible that abort listeners for subagents are not properly unregistered when the subagent is done? I don't see the subagents as distinct
node/claudecode processes, so this seems plausible.Same here as @dgarson . Since the 1.0.44 release of Claude Code, I was no longer seeing this warning. However, with version 1.0.52, the issue has resurfaced.
mickael in www/freela/mep
❯ claude -v
1.0.52 (Claude Code)
I do see it , but it's pretty rare like a pokemon, let me try spot it today.
Got this issue and it's not just the warning but a full on crash - details including log and version below under . This was running latest claude 1.0.53
This did happen during running
claude --dangerously-skip-permissions. There are some hooks defined which have been throwing some warnings too, but have been totally fine that way until yesterday. And then - got this TWICE within an hour.This fully halted the process so
got this today after the auto update (no changelog) to 1.0.53 : Now let me have the working group collaborate on the solution:
(node:481) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. Use events.setMaxListeners() to increase limit
(Use
node --trace-warnings ...to show where the warning was created)Definitely need more people to observe if there's a correlation, since it's far from a large sample size, but the last 5 of 5 times I saw it, it was immediately before a subagent "Task N: ...." appeared in my console.
(node:22362) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
(Use
node --trace-warnings ...to show where the warning was created)Happens when launching sub-agents in parallel for me, latest version of CC
no correlation with sub tasks just started happening out of the blue. I am getting this in vscode btw, I didn't see anyone call out the platform yet. if i shutdown vscode completely and come back to cc it seems to resolve it. I am using the cc extension.
Just saw this appear after it started reading multiple files
(node:2409896) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
1.0.55 (Claude Code)
Same here for me, happening constantly
MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
@ashwin-ant I think we may need to reopen this. I'm seeing this often as well now
This is a recurring issue that I encounter regularly. Windows, version v1.0.57
Are people still seeing this in 1.0.58?
I haven't seen it recently.
On Tue, Jul 22, 2025 at 10:24 PM Ashwin Bhat @.***>
wrote:
--
Rob Schmidt
sure are , confirmed version
(node:26248) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
Yes, 1.0.58
Yes. Multiple time so far today.
Claude Code version 1.0.58
Node version 24.4.1
OS: MacOS 15.5 (24F74)
While running inside VSCode Dev Container.
Just got one again:
version 1.0.60
While debugging a CSS issue (width: 100% not applying correctly), Claude quickly hits this warning:
It seems that subagents add abort listeners without cleanup, leading to listener bloat. After a few minutes, usage limits (Max 5x) are hit and the task fails.
Extra info: It was using Browser MCP while debugging, Claude Code 1.0.63, Linux
I ran into this same issue on Claude Code 1.0.63, OS X, and got the same error today, and hit my Max 20x usage limit (for the first time ever) shortly after.
Why was today different?
I enabled subagents yesterday and was able to run agent chains without issues over the entire day. It was today that I set up hooks to more consistently use parallel sub-agents that I was seeing with my CLAUDE.md alone. It was working great until it wasn't.
I was not doing anything heavier today than I have been over the past month+, so if this issue contributed to hitting my limit in <5 hours of use today...then looking forward to a fix. (till then, reverting my config to last known good)
same issue
Claude Code v1.0.71
L Session ID: 89f495f2-b507-4e47-9840-e6d836b3d36d
We've put in a bunch of different fixes on this issue over the past month, and I put in one more today. I'm going to go ahead and close this issue so that we can get some signal on whether we still have this issue—please reopen if you're still seeing this!
Still seeing this:
I'll use agents to migrate the existing plugins to the new framework in parallel:
(node:87275) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 51 abort listeners added to [AbortSignal]. MaxListeners is 50. Use events.setMaxListeners() to increase limit
(Use
node --trace-warnings ...to show where the warning was created)❯ claude --version
1.0.89 (Claude Code)
I still see this as well, not quite as often but it still shows up in 1.0.89
+1, still seeing this, using around 5 subagents and 2 MCPs to run through a workflow. 1.0.96
Same here, 10.0.96, node 24, with 10 subagents and no MCPs.
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.