[BUG] Claude VSCode Extension: Chat output splits every word or character into a new line

Status Fixed / completed
Maintainer reply None cached
Activity 9 comments · opened Nov 25, 2025 · closed Dec 8, 2025

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?

When using the Claude VSCode Extension chat, the agent's plain text output is split so that each word or character appears on a separate line. For example, if the answer should be "I'm doing well, thanks!", it appears as:

I'm
doing
well
,
thanks
!

This only affects the chat/plain text answers. Code blocks and editor outputs are not split.

What Should Happen?

Claude should produce chat answers as regular, properly formatted sentences.

Error Messages/Logs

No error messages appear. The issue is visual/output formatting only.

Steps to Reproduce

Open VSCode and the Claude VSCode Extension.

Ask the Claude agent a plain text question in the chat, like "How are you?".

The reply will be split so that each word or character appears on a new line, instead of in a normal sentence.

See attached screenshot for an example.

<img width="1296" height="763" alt="Image" src="https://github.com/user-attachments/assets/4a1318d4-c0ad-40b0-8c24-bfd16ab29df3" />

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

idk

Claude Code Version

2.0.50 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Tried changing VSCode theme and updating extension, issue persists.

Issue affects only chat/message output, not code or formatted editor responses.

Attaching screenshot for reference (see below).

View original on GitHub ↗

9 Comments

github-actions[bot] · 9 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/12290
  2. https://github.com/anthropics/claude-code/issues/12157
  3. https://github.com/anthropics/claude-code/issues/6827

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

JuanCS-Dev · 9 months ago

Root Cause: VSCode Markdown Rendering Bug

Your chat output is being treated as Markdown list items instead of plain text.

Why This Happens

VSCode's webview renderer sees each line break and interprets it as:

I'm
doing
well
,
thanks
!

Instead of:

I'm doing well, thanks!

Root cause: Claude Code VSCode extension is inserting \n after every word/token in streaming response.

Immediate Workaround

Option 1: Use Terminal Instead

# Don't use VSCode extension, use standalone CLI
npm install -g @anthropic-ai/claude-code
claude
# Output renders correctly in terminal

Option 2: Copy/Paste Output

- Click "Copy" button on Claude's response
- Paste into text editor
- Text will be properly formatted (single lines)

Option 3: Downgrade Extension

# In VSCode:
# Extensions → Claude Code → Gear icon → Install Another Version
# Select 2.0.49 or earlier (before regression)

Technical Analysis

Suspect code location (in VSCode extension):

// Broken streaming handler:
response.on('data', (chunk) => {
  const token = chunk.toString();
  webview.postMessage({
    type: 'append',
    content: token + '\n'  // ← BUG: Extra newline
  });
});

// Should be:
response.on('data', (chunk) => {
  const token = chunk.toString();
  webview.postMessage({
    type: 'append',
    content: token  // No newline unless token ends with \n
  });
});

Proper Fix (For Anthropic Team)

In webview message handler:

// src/webview/ChatRenderer.tsx (or similar)

handleAppendMessage(message: AppendMessage) {
  const { content } = message;
  
  // Buffer tokens until sentence boundary
  this.textBuffer += content;
  
  // Only render complete sentences
  if (content.match(/[.!?]\s*$/)) {
    this.renderText(this.textBuffer);
    this.textBuffer = '';
  }
}

Or simpler - remove extra newlines:

handleAppendMessage(message: AppendMessage) {
  // Strip extra newlines from streamed tokens
  const cleaned = message.content.replace(/\n+/g, ' ');
  this.appendToChat(cleaned);
}

Verification

After fix:

// Test case:
const testInput = "I'm\ndoing\nwell\n,\nthanks\n!";
const output = cleanStreamedText(testInput);
console.assert(output === "I'm doing well, thanks!");

Why This is a Regression

v2.0.49: Worked correctly
v2.0.50+: Started splitting every word

Likely change: Streaming implementation was modified to improve responsiveness but introduced newline bug.

Related Issues

This might be the same root cause as:

  • Terminal text rendering issues
  • Copy/paste formatting problems
  • Markdown parsing errors in chat

Suspect: Unified text rendering pipeline was changed across all interfaces.

---

Workaround: Use terminal CLI instead of VSCode extension until fixed.
Priority: P1 - Breaks primary use case (VSCode chat)

iwangbowen · 9 months ago

@JuanCS-Dev it also happened to Claude Code CLI

isiddharthsingh · 9 months ago

this is happening with me in cli and the extensions both. i tried downgrading it but then it was not able to receive any response. i tried downgrading to all from latest to 2.0.35.

please fix this asap

aritroCoder · 9 months ago

Hi, It is not working on both claude code cli and claude code vs code extension. Both of them are basically unusable now due to the new lines after each word generation. This is a critical issue, please fix it

mgoku · 9 months ago

Happened to me in the CLI, but only on Mac. On Linux, it work fine

isiddharthsingh · 9 months ago

just tested it, it working for me in version 2.0.54

kristiangasic · 9 months ago

After updating to version 2.0.55, the issue no longer occurs.

github-actions[bot] · 8 months ago

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.