[BUG] Conversation content duplicates 3x when code is written - scrollbar glitches (VS Code terminal)

Resolved 💬 7 comments Opened Dec 27, 2025 by Yi-Yi-y Closed Mar 1, 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?

OS and Version:

  • Microsoft Windows 10 Pro
  • Version 10.0.19045 (Build 19045.6466)

Terminal/Shell:

  • Terminal: Visual Studio Code (VS Code integrated terminal)
  • Shell: Bash

---
Complete bug report info:

Claude Code Version: 2.0.75
OS: Windows 10 Pro 10.0.19045 (Build 19045.6466)
Terminal: Visual Studio Code integrated terminal
Shell: Bash

Bug: Chat UI duplicates entire conversation 3x when any code is written

  • Scrollbar glitches and flashes erratically
  • Conversation shows start, middle, and end sections repeated multiple times
  • Must scroll through duplicated content to reach current conversation
  • Happens immediately when code appears
  • Affects ALL chats (new and existing)
  • Makes Claude Code nearly unusable for coding tasks

claude-debug-log.txt

What Should Happen?

The conversation should display only once without any duplication. The scrollbar should function normally without glitching or flashing. When code is written or displayed, the chat should remain at the current position, showing each message exactly one time. Users should be able to scroll smoothly through the conversation history without encountering repeated sections.

Or more concisely:

  • Conversation messages should appear only once (no duplication)
  • Scrollbar should work smoothly without glitching
  • No repeated sections of start/middle/end content
  • Chat should stay at current position when code appears

Error Messages/Logs

No error messages displayed in console or UI.
  Only visual symptoms: scrollbar glitching and conversation content 

Steps to Reproduce

● Steps to Reproduce:

  1. Open Claude Code in VS Code integrated terminal (using Bash shell)
  2. Start any conversation (new or existing)
  3. Ask Claude to write, edit, or display any code
  4. Bug occurs immediately when code appears in the chat

Observed behavior:

  • Scrollbar begins glitching and flashing erratically
  • Conversation content duplicates and shows start, middle, and end sections repeated ~3 times
  • Must scroll down through duplicated content to reach the actual continuation of the conversation
  • Affects ALL conversations (new and old) consistently

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Unknown - issue has been occurring since I started using this version but did work on previous versions with no issues.

Claude Code Version

2.0.75

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Platform:
Windows 10 Pro 10.0.19045 (Build 19045.6466)

Terminal/Shell:
VS Code integrated terminal / Bash

Additional Information:

  • This is a critical usability bug that makes Claude Code nearly unusable for coding tasks
  • Occurs 100% of the time when any code is written or displayed
  • Reproducible across all conversations (new and existing)
  • The duplication appears to be a rendering/UI issue, not a data storage issue
  • Scrollbar behavior becomes extremely erratic when the bug occurs
  • May be related to issue #826 (scrollbar problems) but is distinctly different due to content duplication

''This error originated either by throwing inside of an async function without a catch block, or
by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: EBADF: bad file descriptor, realpath 'C:\Users\Robean\.claude\history.jsonl.lock'
at async realpath (node:internal/fs/promises:1173:10)
at async mi1._addToNodeFs (file:///C:/Users/Robean/AppData/Roaming/npm/node_modules/@anthropi
c-ai/claude-code/cli.js:448:10239)
I just saw this error now. Is it related to the bug, or not? It disappears randomly on its own,
and then returns randomly.

● This is likely related - here's why:

The Error Breakdown:
EBADF: bad file descriptor, realpath 'history.jsonl.lock'

This means Claude Code is trying to access a file handle that's already been closed or is invalid.
The .lock file is used to prevent multiple processes from writing to the conversation history at the
same time.

Possible Connection to Duplication Bug:

If the UI is rendering the conversation multiple times, it might also be:

  1. Reading the history file multiple times simultaneously
  2. Creating race conditions with file locks
  3. Corrupting file handles when trying to access history data
  4. Attempting to re-render while the history file is still being written

The fact that it appears and disappears randomly suggests a timing/race condition - exactly what you'd expect if the UI is trying to read/render the same data multiple times concurrently.

Add this to your bug report:

Additional Error Observed:
Error: EBADF: bad file descriptor, realpath 'C:\Users\Robean\.claude\history.jsonl.lock'

  • Appears and disappears randomly
  • Occurs during conversation rendering
  • May indicate race condition in file handling when UI duplicates content
  • Could be related to conversation duplication bug (UI rendering multiple times → file accessed multiple times simultaneously)

This gives developers another angle to investigate - it's not just a UI bug, there may be underlying file handling issues too.''

DUPLICATION-BUG-EVIDENCE.md
discord-plugin-conversation.txt

View original on GitHub ↗

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