claude-code - 💡(How to fix) Fix [BUG] /agents view on Windows leaks orphan Windows Terminal XAML host on exit (taskbar tile reading "DesktopWindowXamlSource")

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…

Error Message

Error Messages/Logs

no error, just a "DesktopWindowXamlSource" tile on my taskbar that doesn't open anything

Root Cause

  • Restarting explorer.exe does NOT clear the tile — the underlying window is real, not a cache artifact.
    • Clearing iconcache*.db / thumbcache*.db does NOT help, same reason.
    • A EnumWindows sweep filtering on IsWindowVisible() == true does not surface the orphan because it is DWM-cloaked. A broader sweep (no visibility filter, dumping class + title for all top-level windows) is the correct way to detect it.
    • The jump list and "Close window" option in the tile's context menu confirm the orphan is a WindowsTerminal.exe process distinct from the user's active terminal.
    • Manual workaround: right-click the tile → "Close window" cleans up the current orphan but the leak recurs on next session close.

Fix Action

Fix / Workaround

  • Restarting explorer.exe does NOT clear the tile — the underlying window is real, not a cache artifact.
    • Clearing iconcache*.db / thumbcache*.db does NOT help, same reason.
    • A EnumWindows sweep filtering on IsWindowVisible() == true does not surface the orphan because it is DWM-cloaked. A broader sweep (no visibility filter, dumping class + title for all top-level windows) is the correct way to detect it.
    • The jump list and "Close window" option in the tile's context menu confirm the orphan is a WindowsTerminal.exe process distinct from the user's active terminal.
    • Manual workaround: right-click the tile → "Close window" cleans up the current orphan but the leak recurs on next session close.

Workaround in use

Code Example

no error, just a "DesktopWindowXamlSource" tile on my taskbar that doesn't open anything
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?

Summary

After using the /agents view in Claude Code on Windows, closing the Claude Code session leaves an orphan Windows Terminal process. The orphan registers a separate taskbar tile labeled "DesktopWindowXamlSource" (the fallback class name shown when the window's AppUserModelID isn't properly set). The orphan window is DWM-cloaked (invisible to the user), but visible in the taskbar. Right-clicking the tile shows a normal Windows Terminal jump list (PowerShell, Command Prompt, Azure Cloud Shell, Git Bash) plus a "Close window" entry, confirming it is a real Windows Terminal process.

Environment

  • OS: Windows 10 Enterprise N LTSC 2021, version 10.0.19044
  • Claude Code: 2.1.142
  • Windows Terminal: 1.24.11321.0 (MSIX)
  • Shell: PowerShell 7.6.1
  • Model in use: Opus 4.7 (1M context)

Reproduction

  1. Open Windows Terminal.
  2. Run claude to start a Claude Code session.
  3. Type /agents to open the agents view at least once during the session.
  4. Exit Claude Code normally.
  5. Observe: a new tile labeled "DesktopWindowXamlSource" appears on the taskbar. Clicking it does nothing visible. Right-click reveals a Windows Terminal jump list and a "Close window" option.

The orphan reappears every time /agents is used, on every session close.

Expected behavior

The XAML host created by /agents view should be disposed when the view closes (or at the latest when the Claude Code session exits). No orphan window or taskbar tile should remain.

Diagnostic notes

  • Restarting explorer.exe does NOT clear the tile — the underlying window is real, not a cache artifact.
  • Clearing iconcache*.db / thumbcache*.db does NOT help, same reason.
  • A EnumWindows sweep filtering on IsWindowVisible() == true does not surface the orphan because it is DWM-cloaked. A broader sweep (no visibility filter, dumping class + title for all top-level windows) is the correct way to detect it.
  • The jump list and "Close window" option in the tile's context menu confirm the orphan is a WindowsTerminal.exe process distinct from the user's active terminal.
  • Manual workaround: right-click the tile → "Close window" cleans up the current orphan but the leak recurs on next session close.

Suspected cause

The /agents view spawns or hosts a XAML Island in a Windows Terminal host window without inheriting Windows Terminal's AppUserModelID, and does not dispose the host on exit. Windows falls back to the XAML class name "DesktopWindowXamlSource" for the tile label because no AUMID was set.

Workaround in use

Avoiding /agents view. Right-click → Close window when the tile appears.

What Should Happen?

closing claude code should't leave a "DesktopWindowXamlSource" tile on my windows taskbar.

Error Messages/Logs

no error, just a "DesktopWindowXamlSource" tile on my taskbar that doesn't open anything

Steps to Reproduce

closing claude code leaves a "DesktopWindowXamlSource" on my taskbar

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

latest

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

No response

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

claude-code - 💡(How to fix) Fix [BUG] /agents view on Windows leaks orphan Windows Terminal XAML host on exit (taskbar tile reading "DesktopWindowXamlSource")