Claude Code is stuck
Which word Claude Code freezes on tells you the cause. Connectivity is a proxy bug with a fix, thinking is a stalled stream, compacting is something else again.
Claude Code freezing looks like one problem. It isn't — the word it's stuck on identifies the cause, and the three common ones have nothing in common.
| Stuck on | Cause | Fixable by you? |
|---|---|---|
Checking connectivity… | Proxy-unaware startup check | ✅ Yes — update |
Thinking / Almost done thinking | Stalled response stream | ⚠️ Partly |
Compacting conversation | Compaction rejects thinking blocks | ⚠️ Workaround only |
| Loading models, reading files | Usually the same stream stall | ⚠️ Partly |
Stuck on "Checking connectivity"#
This one has a real fix. If Claude Code hangs at startup before you can type anything — #15615 on macOS, #25888 on a fresh CLI install — the startup connectivity check was not proxy-aware. It used a different transport from the one API requests use, so behind an HTTPS proxy it hung forever while everything else would have worked.
That has since been fixed to use the same proxy-aware transport as API requests. So:
npm i -g @anthropic-ai/claude-code@latest
claude --versionIf you're behind a corporate proxy and still stuck after updating, the certificate path is the next suspect — Claude Code is compiled with Bun, so NODE_EXTRA_CA_CERTS is often ignored. Full proxy and certificate guide →
Stuck on "Thinking" for minutes#
#26224 documents sessions hanging 5–20 minutes or more on ordinary prompts.
The reporter did the diagnostic work that makes this identifiable:
Token usage does not go up during this time, and packet inspection shows it hanging waiting for SSE events from Anthropic.
Both halves matter:
- Flat token usage means the model isn't working. It isn't a hard problem taking a long time — nothing is happening.
- Waiting on SSE events means the response stream opened and then went silent. The client is holding a connection that will never deliver.
How to tell this apart from a slow prompt#
Watch the token counter. If it climbs, the model is working and you're just impatient. If it's frozen while the spinner turns, the stream has stalled.
What actually helps#
Interrupt and resend. Esc or Ctrl-C, then send again. A stalled stream will not recover on its own, and waiting costs you the difference.
Keep sessions shorter. /clear between unrelated tasks. Long sessions correlate with stalls, which is the same pattern behind the ECONNRESET connection-pool reports.
Update. Stream handling changes between builds.
npm i -g @anthropic-ai/claude-code@latestCheck status before debugging your own setup. A stalled stream can be upstream capacity rather than anything local — see 529 overloaded and status.anthropic.com.
Stuck on "Compacting conversation"#
Compaction summarises an over-long conversation so the session can continue. When it fails, the session can't move forward.
#13086 reports the specific failure:
Cannot modify thinking blocks during message compactionThe constraint behind it is that thinking and redacted_thinking blocks in the latest assistant message must remain exactly as they were in the original response. Compaction tries to rewrite history, hits those immutable blocks, and fails. #15213 reports /compact failing to compact at all.
What to do: don't fight it. Start a fresh session and carry over only what matters.
/clearThen paste a short summary of the state you need. That is faster and more reliable than repeatedly retrying a compaction that will keep hitting the same immutable blocks.
Stuck in VS Code specifically#
If the CLI works and only the extension hangs, the fault is in the integration rather than Claude Code itself. Reload the window, and confirm the CLI works standalone in a terminal:
claude --version
claudeThat one check separates "Claude Code is broken" from "the extension is broken", and they get fixed in different places.
General recovery order#
# 1. is anything actually happening? watch the token counter, then interrupt
# Esc or Ctrl-C
# 2. update — stream and connectivity handling change between builds
npm i -g @anthropic-ai/claude-code@latest
claude --version
# 3. start clean rather than resuming a stalled session
claude# 4. confirm the API is reachable at all
curl -sS -o /dev/null -w "%{http_code}\n" https://api.anthropic.com/v1/messagesA 405 there is success — you reached Anthropic. If that works while Claude Code hangs, the problem is in the client, not your network. Full connection diagnostic →
FAQ#
Why is Claude Code stuck on "Checking connectivity"?#
The startup connectivity check wasn't proxy-aware and used a different transport from API requests, so it hung indefinitely behind an HTTPS proxy. This has been fixed — update with npm i -g @anthropic-ai/claude-code@latest.
Why does Claude Code hang on "Thinking" for 10 minutes?#
The response stream stalled. The tell is that token usage stays flat while the spinner turns, and packet inspection shows the client waiting on SSE events that never arrive. A stalled stream won't recover, so interrupt and resend rather than waiting.
How do I fix Claude Code stuck on compacting?#
Compaction can fail because thinking blocks in the latest assistant message cannot be modified. Rather than retrying, run /clear and start a fresh session with a short summary of the state you need to keep.
Is Claude Code stuck or just slow?#
Watch the token counter. If it's increasing, the model is working. If it's frozen while the spinner animates, the stream has stalled and waiting won't help.
Claude Code hangs in VS Code but works in the terminal — why?#
That points at the extension's integration rather than Claude Code itself. Reload the VS Code window; if the terminal CLI works standalone, report it against the extension.