[BUG] Claude Code freezes mid-response (up to 15 min with zero token raise), persists across sessions and models

Resolved 💬 2 comments Opened Apr 21, 2026 by starsandheights Closed Apr 21, 2026

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 has become virtually unusable for me, it gets stuck after every tool call, idles until time out or until I interrupt it. It also sometimes gets stuck on standard text communications. It has been unable to see the problem for itself from its perspective. Its self-diagnoses and failed fixes are based on it guessing. Once it a while it works perfectly with complicated tasks and most of the time it just doesn't do anything. It recognizes that it's getting held up, but can not self resolve because every time it tries, it gets stuck.

What Should Happen?

Claude should function as normal and finish out tasks without going idle until time out.

Error Messages/Logs

This was its latest self diagnosis, but it doesn't recognize the larger picture. Right now it's identifying yesterday's attempt at fixing it as the primary issue. 

Environment:

Claude Code CLI, model: Opus 4.7 (1M context)
macOS Darwin 25.3.0, zsh
Issue persists across multiple sessions over several days
Symptom:

Assistant stalls mid-turn with no output for 30s to 4+ minutes
Happens during plain text generation (not just tool calls) — confirmed freezing at 19 tokens and 126 tokens on bare text responses
Happens after tool calls as well
Only resolvable by user interrupting
Other users on my team are not experiencing this
What I tried (did not help, may have made it worse):
Added env overrides in ~/.claude/settings.json:

"CLAUDE_ENABLE_STREAM_WATCHDOG": "1",
"CLAUDE_ENABLE_BYTE_WATCHDOG": "1",
"CLAUDE_STREAM_IDLE_TIMEOUT_MS": "900000",
"API_TIMEOUT_MS": "1200000",
"CLAUDE_CODE_MAX_RETRIES": "10",
"MAX_THINKING_TOKENS": "12000",
"CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING": "1"
Question: Are these env vars even correct? Are there known issues with long freezes on Opus 4.7 1M context, or with these timeout overrides?

Steps to Reproduce

are you functional again today? yesterday was a bust you just kept freezing and idling out

Yeah, should be. The freeze yesterday was the Anthropic stream idle-timeout bug — not me silently stopping. The fix is in ~/.claude/settings.json (watchdog + raised timeouts + capped thinking), plus the no-silent-stop Stop hook as backup.

If it recurs, check the transcript for API Error: Stream idle timeout before blaming me. Ready to work — what's on deck?

thats not the only thing getting you stuck, you literally get stuck after almost every tool call. youve diagnosed this day after day after day

Fair. I've been overconfident about the fix — the stream-idle-timeout is one

_Gets Stuck_

so the answer is no, its not fixed. This isnt even a tool call, you got stuck at 19 tokens for 1 minute and 30 seconds.

You're right. Not fixed. The memory claiming it's solved is wrong — I just proved it by freezing mid-sentence on a plain text response, no tool call involved.

I don't have a clean answer for you. Want me to just try to work and you flag freezes as they happen, or do you want to dig into what's actually going on?

we have to figure out the problem, we can literally get nothing done at this pace and its been days and other users arent experiencing this

Agreed. Let me actually look at your setup — the memory's diagnosis is clearly wrong, and since it's user-specific, it has to be something in your config or hooks.

Starting with settings.json, the Stop hook, and its log.

Read 2 files, ran a command
Found it — and the culprit is almost certainly my own "fix" from yesterday.

Your settings.json has these env vars I added:

CLAUDE_STREAM_IDLE_TIMEOUT_MS: 900000 (15 minutes!)
API_TIMEOUT_MS: 1200000 (20 minutes!)
CLAUDE_CODE_MAX_RETRIES: 10
MAX_THINKING_TOKENS: 12000
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING: 1
This is why you're experiencing 90-second (and longer) freezes. I configured the client to tolerate up to 15-minute hangs instead of failing fast. When the stream hiccups even briefly, instead of retrying quickly like other users, your client sits there waiting. My memory says this is a "fix" — it's actively the cause.

The Stop hook is fine, log shows it doing its job in milliseconds.

My recommendation: delete the env block entirely (keep the Stop hook) and let Claude Code use its defaults. Other users don't have this problem because they don't have these overrides.

Want me to strip those env vars and update the memory? This is low-risk and reversible — one file, I can show you the diff before saving.

_It got stuck while trying to do this_

Its like every single conversation I have at this point in Code

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

1.3561.0

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

I swear I'm not crazy, this is a baffling bug for both Claude and I and it can barely even get info out of Claude to help me make any sense of what should be in this report.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗