claude-code - 💡(How to fix) Fix [BUG] Interleaved thinking causes text to render character-by-character in TUI and IDE plugin [1 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#51884Fetched 2026-04-23 07:42:20
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×5

When interleaved-thinking-2025-05-14 beta header is active, the TUI and IDE plugin render text responses character-by-character, with each character appearing as a separate list item interleaved with "Thought for 0s" blocks.

Error Message

Error Messages/Logs

Root Cause

Root Cause (identified)

Fix Action

Workaround

None currently available from user side.

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?

Description

When interleaved-thinking-2025-05-14 beta header is active, the TUI and IDE plugin render text responses character-by-character, with each character appearing as a separate list item interleaved with "Thought for 0s" blocks.

Environment

  • Claude Code version: 2.1.117
  • OS: macOS (arm64)
  • Occurs in: CLI TUI + CatPaw IDE plugin

Steps to Reproduce

  1. Start a new Claude Code session
  2. Ask any question that triggers interleaved thinking
  3. Observe the response rendering

Expected Behavior

Text renders normally as continuous output.

Actual Behavior

Each character appears as a separate bullet point, interleaved with "Thought for 0s" blocks:

  • Thought for 0s
  • Thought for 0s
  • ...

Root Cause (identified)

The request header includes interleaved-thinking-2025-05-14 (hardcoded in CLI source). This causes the API to return interleaved thinking and text content blocks in the stream. The TUI renderer does not correctly handle interleaved block types — it renders each delta event as a new list item instead of grouping by block index.

Setting alwaysThinkingEnabled: false or effortLevel: low in ~/.claude/settings.json does NOT fix the issue because the beta header is hardcoded.

Workaround

None currently available from user side.

What Should Happen?

The correct rendering logic should be:

On content_block_start → create a new block slot by index, type is either thinking or text On content_block_delta → append the delta to the existing block at that index On content_block_stop → finalize and render that block thinking blocks render as a collapsible "Thought for Xs" summary, text blocks render as normal continuous text.

What's happening now is the renderer skips the grouping step — every content_block_delta event triggers a new render item regardless of index or type, so each character becomes its own bullet point with a "Thought for 0s" in between.

Error Messages/Logs

Steps to Reproduce

1

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.117 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

extent analysis

TL;DR

The issue can be fixed by modifying the TUI renderer to correctly handle interleaved block types, specifically by grouping delta events by block index instead of rendering each as a new list item.

Guidance

  • The root cause is identified as the TUI renderer not handling interleaved block types correctly, causing each character to be rendered as a separate list item.
  • To fix this, the rendering logic should be updated to create a new block slot by index and type on content_block_start, append deltas to the existing block on content_block_delta, and finalize and render the block on content_block_stop.
  • The interleaved-thinking-2025-05-14 beta header is hardcoded in the CLI source and causes the API to return interleaved thinking and text content blocks, which the current renderer cannot handle.
  • Setting alwaysThinkingEnabled: false or effortLevel: low in ~/.claude/settings.json does not fix the issue due to the hardcoded beta header.

Example

No code snippet is provided as the issue does not include specific code that needs to be modified, but the correct rendering logic should follow the steps outlined in the guidance section.

Notes

The issue is a regression and was working in a previous version, but the last working version is not specified. The fix will require modifying the TUI renderer to correctly handle interleaved block types.

Recommendation

Apply workaround: Modify the TUI renderer to correctly handle interleaved block types by grouping delta events by block index, as this is the most direct way to address the issue.

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