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

[BUG] Claude Code gets stuck sporadically

Open Anthoooooooony opened this issue 10 months ago • 3 comments

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?

After I send a message, Claude Code sometimes freezes for 5 minutes straight. The UI shows 0 tokens used and just nothing happens. Eventually Claude Code recovers like nothing was wrong.

What Should Happen?

It should respond normally without the long freeze.

Error Messages/Logs


Steps to Reproduce

  1. Start Claude Code
  2. Send any message
  3. UI freezes with "0 tokens used" showing — this happens sporadically
  4. Have to wait or restart Claude Code

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Versions from 2025-09 worked without this issue

Claude Code Version

2.0.76 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Dug into the network requests and realized there's always a pending request to statsig.anthropic.com when this happens.

Quick proof:

  • Force resolve statsig.anthropic.com to localhost
  • The hang goes away

Anthoooooooony avatar Jan 07 '26 09:01 Anthoooooooony

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/15384
  2. https://github.com/anthropics/claude-code/issues/15823
  3. https://github.com/anthropics/claude-code/issues/13317

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Jan 07 '26 09:01 github-actions[bot]

@Anthoooooooony I have the same problem. I'm using a Max X5 license. What license do you have?

mzebrak avatar Jan 07 '26 11:01 mzebrak

@Anthoooooooony I have the same problem. I'm using a Max X5 license. What license do you have?

Same. @mzebrak

Anthoooooooony avatar Jan 07 '26 13:01 Anthoooooooony

@Anthoooooooony I have the same problem. I'm using a Max X5 license. What license do you have?

Same. @mzebrak

I switched to max x20, and I notice the same issue is happening.

mzebrak avatar Jan 07 '26 17:01 mzebrak

+1 for max x20

tony1223 avatar Jan 17 '26 02:01 tony1223

Have seen hanging behavior consistently for a couple of days. Anecdotally, adding 127.0.0.1 statsig.anthropic.com to /etc/hosts appeared to un-hang the current session immediately, but it didn't help in the long run, saw freezes many times in the hour after.

Cireo avatar Jan 23 '26 19:01 Cireo

It has to be an issue with how the VM binds to the network. Once I turned off tailscale, cowork now works. So this is clear direction. I'm going to experiment more with tailscale options (e.g., ignore for local addresses) to see if I can stay connected to my tailnet with claude cowork. Else, it's not super helpful bc I need those network shares.

UPDATE: Cowork hangs indefinitely when connected to any Tailnet, regardless of exit node or local network access settings. Note that Chat and Code work fine on the same Tailnet. This makes it a blocker for anyone who needs network share access for cowork.

There are ways to fix this, but it's app level and not user level. I'm guessing it's binding to 127.0.0.1 and should instead bind at 0.0.0.0. Of course, then needs to reject any IP other than Anthropic's.

UPDATE 2: Found the issue! It's how tailscale handles DNS routing. Anthropic still needs to fix DNS routing (way less complicated than binding), but you can solve IF tailscale is the problem by turning off "Use Tailscale DNS settings". That's actually fine for me since my tailnet boxes now route through adguard DNS, so solves 2 problems :)

Tailscale's DNS resolver is what's breaking Cowork, not the binding or routing. This is actually great news because:

chitownjk avatar Jan 27 '26 14:01 chitownjk

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] avatar Mar 01 '26 10:03 github-actions[bot]

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.

github-actions[bot] avatar Mar 10 '26 14:03 github-actions[bot]