claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Hanging / Freezing in the middle of work - CPU sample attached

Open guidedways opened this issue 6 months ago • 34 comments

Environment

  • Platform (select one):
  • Claude CLI version: claude 1.0.10, node version v23.11.0
  • Operating System: macOS 15.5
  • Terminal: iTerm2
  • Feedback ID: a80a33ea-5a52-4894-90d0-e36f4aca41fc

Bug Description

Claude code has started hanging and freezing in the middle of its work. It remains hung indefinitely. The only way to get out of this hang is to quit and relaunch the terminal but then the work is lost. Started happening after 1.0.9 I believe.

Steps to Reproduce

  1. Any prompt
  2. Starts working normally
  3. After a few steps it hangs on whatever it's doing - no animation, cannot type anything, cannot hit escape - nothing.

I can see in Activity Monitor node is hung, here's a CPU sample attached.

sample.txt

guidedways avatar Jun 04 '25 05:06 guidedways

Another CPU sample, freezing constantly.

sample2.txt

guidedways avatar Jun 04 '25 05:06 guidedways

Happens to me also constantly since 1.0.10, though it does "unfreeze" itself after quite a long wait.

sepsi77 avatar Jun 04 '25 05:06 sepsi77

True, I let it run this time for 15 minutes and it came back to life, only to hang again. I can see the CPU spike in Activity Monitor too.

I've just upgraded node to v24, killed all instances of node in the background, relaunched claude and so far so good.

guidedways avatar Jun 04 '25 05:06 guidedways

Spoke too soon :( 100% cpu usage again after a minute of work.

guidedways avatar Jun 04 '25 05:06 guidedways

I'm using Claude Code inside of Cursor / VS Code and it seems to be a bit more reliable. I rarely get long freezes - it does freeze for maybe 30 seconds but always comes back to life. Node CPU usage does spike occasionally but not to very high levels.

sepsi77 avatar Jun 04 '25 05:06 sepsi77

also seeing this on apple silicon macbook w/ claude code 1.0.10 in amd64 (rosetta) devcontainer with node 24.1

i think the issue is not present in earlier versions (e.g. 1.0.6?)

tosh avatar Jun 04 '25 10:06 tosh

Hey all, by any chance are you using any MCP servers? And can you share if they're using STDIO or SSE?

ashwin-ant avatar Jun 04 '25 18:06 ashwin-ant

@ashwin-ant only playwright-mcp, but haven't actively used the mcp in the session before or during the hang/freeze

tosh avatar Jun 04 '25 18:06 tosh

Seeing the same on Ubuntu 22.04, after the latest claude code update.

arickuter avatar Jun 04 '25 19:06 arickuter

@rboyce-ant https://github.com/anthropics/claude-code/issues/1601 has different symptoms than this issue. In https://github.com/anthropics/claude-code/issues/1601 claude code crashes right away without freezing or hanging.

Does claude code have log files to look at, to get more information why it crashes?

nickolay-kondratyev avatar Jun 04 '25 22:06 nickolay-kondratyev

Same issues for me today on Ubuntu. Freezing quite a bit, hanging for upto 15 minutes at a time. no MCP servers in use.

atkinsonben avatar Jun 05 '25 04:06 atkinsonben

hanging still present in 1.0.11

1.0.7 does not hang for me:

npm install -g @anthropic-ai/[email protected]

and disable auto update

claude config set -g autoUpdaterStatus disabled

tosh avatar Jun 05 '25 18:06 tosh

Hi all, please try updating to v1.0.15, as we believe this issue should be mitigated in the latest release

rboyce-ant avatar Jun 06 '25 00:06 rboyce-ant

@rboyce-ant I think it is no longer happening in 1.0.16

what was it?

tosh avatar Jun 06 '25 14:06 tosh

Yes seems much better. Still get the timer hanging a bit now and then. But far better. No long or huge freezes.

arickuter avatar Jun 06 '25 14:06 arickuter

I just experienced the hang again in 1.0.16

tosh avatar Jun 06 '25 15:06 tosh

Still happening in 1.0.17 and 1.0.18, also switched to a completely different devcontainer with ubuntu 25.04 with zsh instead of bash but same problem:

A few minutes into a session the ui hangs/freezes indefinitely and does not recover, sometimes during typing, sometimes while Claude Code is working on something.

When this happens even repeatedly using control-c or control-d is not stopping the process.

1.0.7 works without hanging.

tosh avatar Jun 10 '25 12:06 tosh

I'm not sure why and/or when exactly but 1.0.20+ (I think) work fine now!

no hanging

tosh avatar Jun 15 '25 17:06 tosh

Claude Code hangs for several seconds (sometimes tens of seconds) with 100% CPU usage very frequently in my case, almost after every tool execution. I'm on Ubuntu 22.04 and Claude Code 1.0.35 (it's been an issue for quite a few releases already, I just finally got frustrated enough to report now).

chemeris avatar Jun 28 '25 14:06 chemeris

This could be related for users of WSL and Docker Desktop - https://github.com/anthropics/claude-code/issues/619

Even after trying their suggested fixes I can't get claude code to work anymore. I've removed the .claude folders...

Edit: Looks like there was a bad update 7/8/25. Installing Claude Code with npm again is working.

roryeckel avatar Jul 08 '25 23:07 roryeckel

When I paste anything into the Claude session, it hangs.

richfergus avatar Aug 18 '25 05:08 richfergus

Yes started again in 1.0.83. I've since downgraded do 1.0.71

guidedways avatar Aug 18 '25 06:08 guidedways

Yes started again in 1.0.83. I've since downgraded do 1.0.71

Thank you. I'm on 1.0.88 - started hanging for me yesterday (and today) downgraded to 1.0.71 and things are working again

MorningLightMountain713 avatar Aug 22 '25 07:08 MorningLightMountain713

I'm on 1.0.108, still hangs

SaltOfTheFlame avatar Sep 08 '25 09:09 SaltOfTheFlame

also experiencing lots of hanging today on 1.0.117

s00500 avatar Sep 17 '25 10:09 s00500

Nevermind, was not a claude code issue

s00500 avatar Sep 17 '25 14:09 s00500

Out of curiosity, what was it?

mickg10 avatar Sep 20 '25 16:09 mickg10

BTW - same thing on MacOS 26.

mickg10 avatar Sep 20 '25 16:09 mickg10

Out of curiosity, what was it?

bash process that could not be killed due to a driver issue on a serialport...

s00500 avatar Sep 22 '25 09:09 s00500

Had a similar issue where it was interacting with a serial device that had to be unplugged to resume it

yapishu avatar Oct 02 '25 19:10 yapishu