TUI duplicates rendered text in scrollback on long sessions (Windows + Linux)

Status Open
Reported on v2.1.119
Maintainer reply None cached
Activity 13 comments · opened Apr 24, 2026

Bug: TUI duplicates rendered text as scrollback grows (both Windows + Linux)

Version: Claude Code 2.1.119
Platforms reproduced:

  • Windows 10 Pro 19045 — Windows Terminal + Git Bash
  • Linux (terminal emulator)

Symptoms:
After a session runs long (~300k+ tokens, many tool calls), previously-printed output starts duplicating in the scrollback — same assistant message and bash/powershell output appears twice, sometimes offset by a few lines. Makes re-reading prior analysis very hard.

Repro steps:

  1. Long-running session with many Bash / PowerShell tool calls that stream output
  2. Status line + recap banners (※ recap: ...) redraw
  3. Scroll up — previous outputs visible twice

Expected: Each message rendered exactly once in scrollback.

Extra context:

  • Happens independently of terminal font (observed with Consolas on Windows and default on Linux)
  • Happens with ⏵⏵ bypass permissions on mode enabled
  • Recaps enabled (not yet disabled via /config)
  • Final assistant message + recap block appears to be the block most often duplicated

Happy to share redacted transcript on request.

View original on GitHub ↗

13 Comments

NatanaelRibF · 4 months ago

Likely same root cause as #52027 (open, filed 2026-04-22). That issue's author traced it to an Ink renderer layout-change flushing alt-screen buffer regions into scrollback after a modal overlay mount/unmount.

My Windows + Linux repros add evidence that:

  • It's not platform-specific (they reported macOS/Terminal.app)
  • Modal dismissal is one trigger, but not the only one — my sessions had no permission-prompt modal (running ⏵⏵ bypass permissions). Recap banner redraw (※ recap: ...) appears to trigger the same flush path
  • Symptom is identical: static redraws of the same state, same values, single process, single JSONL — render-side only

Leaving this open as companion repro for the Windows/Linux side; cross-linked on #52027.

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/52825
  2. https://github.com/anthropics/claude-code/issues/52547
  3. https://github.com/anthropics/claude-code/issues/51828

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

NatanaelRibF · 4 months ago

Workaround test results (Windows 10):

Tested three mitigations on Claude Code 2.1.119 — none resolved the duplication:

  1. ❌ Migrated from legacy conhost.exe to Windows Terminal (latest from MS Store) → still duplicates
  2. ❌ Set "useAtlasEngine": false in WT profiles.defaults (cold restart of WT) → still duplicates
  3. ❌ Disabled Session recap via /config → still duplicates

Explicit trigger reproduced in all three configurations: resizing the terminal window mid-session causes recent scrollback to re-render into buffer 2–3× (identical content, offset by a few lines).

Also reproduced without any resize in long sessions (>200k tokens) with many streamed Bash / PowerShell tool outputs.

This reinforces @natefosterwarner's hypothesis in #52027: the issue is in the Ink renderer's layout-change handling (modal dismissal, recap banner mount/unmount, and window-resize all trigger the same flush-to-scrollback pathway). Terminal-side toggles cannot patch it.

Environment (unchanged from original report):

  • Claude Code 2.1.119
  • Windows 10 Pro 19045, Windows Terminal (MS Store build)
  • PowerShell + cmd profiles tested, same result
  • CLAUDE_CODE_NO_FLICKER=0 (explicit; not set to 1 to avoid #42703)
NatanaelRibF · 4 months ago

Final definitive workaround (Claude Code 2.1.119, Windows 10):

After testing every terminal-side and settings.json-side toggle, the only effective fix is the environment variable:

CLAUDE_CODE_NO_FLICKER=1

Set as a User environment variable on Windows (persists across sessions). Immediately stops scrollback duplication across all documented triggers (resize, long sessions, large tool outputs, modal dismissal). Activates the fullscreen alt-screen renderer.

What did NOT help (tested systematically):

  • ❌ Migrating from legacy conhost.exe to Windows Terminal
  • "useAtlasEngine": false in Windows Terminal profiles.defaults
  • ❌ Disabling Session recap via /config ("awaySummaryEnabled": false)
  • ❌ Setting "tui": "fullscreen" in ~/.claude/settings.json — either not read by 2.1.119, or the env var overrides it

Trade-off of the env-var fix (known):

  • 🚫 Pasting images via clipboard stops working in fullscreen/alt-screen mode. Workaround: save to disk first and reference via @path.

Suggestion for maintainers: the documented equivalence between tui: "fullscreen" and CLAUDE_CODE_NO_FLICKER=1 in the settings schema may not be wired up in 2.1.119 — the env var works, the settings key does not (at least alone) on this version.

cutuer · 4 months ago

+1 reproducing on Windows 11 Pro 26200 + Git Bash, Claude Code 2.1.119, currently running with /think low effort mode.

Same symptoms as OP: long sessions with many sequential tool calls (Bash, Edit, Read) cause prior assistant messages and tool outputs to redraw / appear twice in scrollback. Especially noticeable after status-line/recap updates.

Happy to share an anonymized transcript if helpful.

cutuer · 4 months ago

Adding a fresh repro on Opus 4.7 / Claude Code (Windows 11):

A single short assistant message ("讀完了 🐰") was rendered 22 times in the TUI on session start. Triggered by:

  • SessionStart hook returning suppressOutput JSON
  • Large CLAUDE.md (~15KB) loaded as project instructions
  • claude-mem context block injected via SessionStart additional context
  • Multiple system-reminder blocks (deferred tools, skills list, auto mode)

The duplication happened on the very first assistant turn — not after long scrollback. Suggests the redraw loop is triggered per system-reminder / hook-context block, not by token count alone.

User counted 22 repeats manually. Will capture screenshot next occurrence.

F0rzend · 4 months ago

I have the same problem on MacOS 26.4.1 (25E253) both in cmux and default Terminal apps.

2.1.123 (Claude Code)

kriona · 3 months ago

I was able to reproduce this with a single question in a brand new window - you can see the "Mid-Season Fairness" header was printed 4 times: claude code duplicate output.txt

royachiron · 3 months ago

anthropic, it's kinda disorienting, we're waiting for you to fix it

aducos · 3 months ago

same on ubuntu

strowk · 3 months ago

Super annoying. At least give us easy way to downgrade back to working version.. I also went in ".claude" and checked that text duplicated in terminal does not appear twice in logs, so it is representation only issue, not something that model produced.
Resuming session would clear out duplicate lines, but this is very poor UX honestly. Claude was always writing way too much stuff for me to read and now it doubles it?

acaloiaro · 3 months ago

Hi @NatanaelRibF — Could you update the title to reflect that this bug is not platform-specific. Perhaps that will help the anthropic team prioritize a fix.

danielo515 · 1 month ago

I can confirm that I'm suffering this issue in MacOS, latest two versions. I'm running claude code in Cmux, so this is really a cross-platform issue.