claude-code - 💡(How to fix) Fix [Bug] Startup header renders multiple times in Windows PowerShell / Terminal (v2.1.119) [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#53764Fetched 2026-04-28 06:47:52
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×3cross-referenced ×2

Error Message

npm warn cleanup Failed to remove some directories [ npm warn cleanup [ npm warn cleanup 'C:\Users\MT2505\AppData\Roaming\npm\[email protected]', npm warn cleanup [Error: EPERM: operation not permitted, unlink 'C:\Users\MT2505\AppData\Roaming\npm\[email protected]\bin\claude.exe'] { npm warn cleanup errno: -4048, npm warn cleanup code: 'EPERM', npm warn cleanup syscall: 'unlink', npm warn cleanup path: 'C:\Users\MT2505\AppData\Roaming\npm\[email protected]\bin\claude.exe' npm warn cleanup } npm warn cleanup ] npm warn cleanup ]

Fix Action

Workaround

Using Windows Terminal app instead of raw PowerShell window reduces (but does not eliminate) the frequency of duplicates.

Code Example

npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     'C:\Users\MT2505\AppData\Roaming\npm\node_modules\@anthropic-ai\.claude-code-ULLbAi6p',
npm warn cleanup     [Error: EPERM: operation not permitted, unlink 'C:\Users\MT2505\AppData\Roaming\npm\node_modules\@anthropic-ai\.claude-code-ULLbAi6p\bin\claude.exe'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'unlink',
npm warn cleanup       path: 'C:\Users\MT2505\AppData\Roaming\npm\node_modules\@anthropic-ai\.claude-code-ULLbAi6p\bin\claude.exe'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
RAW_BUFFERClick to expand / collapse

Bug Description

The Claude Code startup header (logo, version info, model, working directory) renders multiple times in the terminal on Windows, causing the conversation window to be very cluttered with repeated content. This happens not only at startup but also during normal task execution — previous text/UI blocks reappear and stack up multiple times.

Environment

  • OS: Windows 11 Home (Build 10.0.26200)
  • Shell: PowerShell (also observed in Windows Terminal)
  • Claude Code version: v2.1.119 (latest)
  • Node.js: v22.11.0
  • npm: v10.9.0

Steps to Reproduce

  1. Open PowerShell on Windows 11
  2. Run claude
  3. Observe the startup header (logo + version + model + directory + separator line) appears multiple times before the prompt
  4. During normal usage, the same header block repeats again after responses

Expected Behavior

The startup header should appear once, and the TUI should cleanly re-render without duplicating previous blocks.

Actual Behavior

The header block is duplicated 5–8+ times in the terminal output, making it very difficult to read the conversation. Each duplicate is separated by the status bar line ($0.000 | Context window...).

Error Log (npm update attempt)

npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     'C:\Users\MT2505\AppData\Roaming\npm\node_modules\@anthropic-ai\.claude-code-ULLbAi6p',
npm warn cleanup     [Error: EPERM: operation not permitted, unlink 'C:\Users\MT2505\AppData\Roaming\npm\node_modules\@anthropic-ai\.claude-code-ULLbAi6p\bin\claude.exe'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'unlink',
npm warn cleanup       path: 'C:\Users\MT2505\AppData\Roaming\npm\node_modules\@anthropic-ai\.claude-code-ULLbAi6p\bin\claude.exe'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]

(EPERM is expected since Claude Code was running during update — noted for reference)

Suspected Cause

The TUI rendering framework appears to trigger multiple full re-renders on Windows when:

  • Terminal window is resized
  • Window focus changes between tabs
  • Scroll events occur

Each re-render appends the full header block without clearing the previous one.

Workaround

Using Windows Terminal app instead of raw PowerShell window reduces (but does not eliminate) the frequency of duplicates.

Additional Notes

  • This was reported via the Claude Code CLI itself using gh issue create
  • Screenshot available showing 5+ repeated header blocks in a single session

/cc @anthropic-ai/claude-code-team

extent analysis

TL;DR

The issue can be mitigated by modifying the TUI rendering framework to clear previous header blocks before re-rendering.

Guidance

  • Investigate the TUI rendering framework's event handling for terminal window resizes, focus changes, and scroll events to identify why it triggers multiple full re-renders.
  • Consider implementing a mechanism to clear the previous header block before re-rendering to prevent duplication.
  • Review the rendering logic to ensure it only appends new content instead of re-rendering the entire UI.
  • Test the workaround of using Windows Terminal app to see if it reduces the frequency of duplicates and gather more insights.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The provided error log from the npm update attempt does not seem directly related to the issue at hand, but it's noted that the EPERM error is expected since Claude Code was running during the update.

Recommendation

Apply workaround: Using Windows Terminal app instead of raw PowerShell window reduces the frequency of duplicates, although it does not eliminate the issue entirely. This can serve as a temporary solution while the root cause is being investigated and addressed.

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