[BUG] /agents view on Windows leaks orphan Windows Terminal XAML host on exit (taskbar tile reading "DesktopWindowXamlSource")
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?
## 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
- Open Windows Terminal.
- Run
claudeto start a Claude Code session. - Type
/agentsto open the agents view at least once during the
session.
- Exit Claude Code normally.
- 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.exedoes NOT clear the tile — the underlying
window is real, not a cache artifact.
- Clearing
iconcache*.db/thumbcache*.dbdoes NOT help, same
reason.
- A
EnumWindowssweep filtering onIsWindowVisible() == truedoes
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_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗