claude-code - 💡(How to fix) Fix [BUG] Claude Code hanging on on thinking for 10+ minutes at 3,4k tokens [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46195Fetched 2026-04-11 06:26:39
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×6commented ×1

Error Message

Error Messages/Logs

Code Example

n/a
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Claude Code randomly hangs at thinking or other token outputs

<img width="916" height="47" alt="Image" src="https://github.com/user-attachments/assets/73267570-1aea-4db5-9df8-3ed9c66cc829" /> <img width="1558" height="350" alt="Image" src="https://github.com/user-attachments/assets/5289d34d-db8b-44d8-9762-e17c970932a6" />

What Should Happen?

Claude should continue generating tokens

Error Messages/Logs

n/a

Steps to Reproduce

  1. Talk with CC
  2. It might hang

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

v2.1.97

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

This is also the same on WSL and Debian, it seems to hang especially at 3.4K tokens most of the time.

<img width="286" height="35" alt="Image" src="https://github.com/user-attachments/assets/86475d29-d06a-4d79-931d-8c99533caf64" />

extent analysis

TL;DR

Investigate the token generation limit and potential memory issues in the Claude Code version 2.1.97, especially around the 3.4K token mark.

Guidance

  • Verify if the hanging issue is consistently reproducible at the 3.4K token mark across different platforms (Windows, WSL, Debian) to isolate the problem.
  • Check for any memory or resource-intensive operations in the Claude Code that could be causing the hang, particularly in the Opus model.
  • Consider testing with a smaller token output to see if the issue persists, which could indicate a problem with the token generation process.
  • Look into any available configuration options or parameters in the Anthropic API that might be contributing to the hanging issue.

Example

No specific code snippet can be provided without more details on the Claude Code implementation, but investigating the token generation loop or memory allocation for the Opus model could be a starting point.

Notes

The lack of error messages or logs makes it challenging to pinpoint the exact cause. The issue seems to be related to the token generation process, especially at a specific token count, which might indicate a bug or a limitation in the current version of Claude Code.

Recommendation

Apply workaround: Given the consistent hanging issue at the 3.4K token mark, it might be necessary to implement a temporary workaround, such as limiting the token output or adjusting the generation process, until a more permanent fix can be found.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING