[BUG] [Windows] Hook execution creates visible cmd.exe terminal tab in Claude Code UI

Resolved 💬 3 comments Opened Apr 27, 2026 by LeonChuang Closed May 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?

Environment

  • Claude Code version: v2.1.76
  • OS: Windows 11
  • Shell: cmd.exe / bash (via Claude Code)

Description
When a Claude Code plugin defines hooks (e.g., SessionStart, PostToolUse) with "shell": "bash", Claude Code on Windows creates a visible C:\WINDOWS\system32\cmd.exe terminal tab in its own UI for each hook execution. This tab appears briefly on every session start and on every tool use.

Steps to reproduce

  1. Install a plugin that defines hooks with "shell": "bash" (e.g., claude-mem)
  2. Start Claude Code on Windows
  3. Observe: a cmd.exe tab appears in the Claude Code terminal multiplexer

Expected behavior
Hook commands should run silently in the background without creating visible terminal tabs in the UI.

Actual behavior
Each hook execution spawns a visible cmd.exe terminal tab. Closing it manually does not affect functionality, but it is disruptive to the UX.

Additional context
The hook runner in the plugin already sets windowsHide: true when spawning child processes, but this does not help because the terminal tab is created by Claude Code's own hook execution layer, not by the plugin process itself.

What Should Happen?

Environment

  • Claude Code version: v2.1.76
  • OS: Windows 11
  • Shell: cmd.exe / bash (via Claude Code)

Description
When a Claude Code plugin defines hooks (e.g., SessionStart, PostToolUse) with "shell": "bash", Claude Code on Windows creates a visible C:\WINDOWS\system32\cmd.exe terminal tab in its own UI for each hook execution. This tab appears briefly on every session start and on every tool use.

Steps to reproduce

  1. Install a plugin that defines hooks with "shell": "bash" (e.g., claude-mem)
  2. Start Claude Code on Windows
  3. Observe: a cmd.exe tab appears in the Claude Code terminal multiplexer

Expected behavior
Hook commands should run silently in the background without creating visible terminal tabs in the UI.

Actual behavior
Each hook execution spawns a visible cmd.exe terminal tab. Closing it manually does not affect functionality, but it is disruptive to the UX.

Additional context
The hook runner in the plugin already sets windowsHide: true when spawning child processes, but this does not help because the terminal tab is created by Claude Code's own hook execution layer, not by the plugin process itself.

Error Messages/Logs

Steps to Reproduce

Environment

  • Claude Code version: v2.1.76
  • OS: Windows 11
  • Shell: cmd.exe / bash (via Claude Code)

Description
When a Claude Code plugin defines hooks (e.g., SessionStart, PostToolUse) with "shell": "bash", Claude Code on Windows creates a visible C:\WINDOWS\system32\cmd.exe terminal tab in its own UI for each hook execution. This tab appears briefly on every session start and on every tool use.

Steps to reproduce

  1. Install a plugin that defines hooks with "shell": "bash" (e.g., claude-mem)
  2. Start Claude Code on Windows
  3. Observe: a cmd.exe tab appears in the Claude Code terminal multiplexer

Expected behavior
Hook commands should run silently in the background without creating visible terminal tabs in the UI.

Actual behavior
Each hook execution spawns a visible cmd.exe terminal tab. Closing it manually does not affect functionality, but it is disruptive to the UX.

Additional context
The hook runner in the plugin already sets windowsHide: true when spawning child processes, but this does not help because the terminal tab is created by Claude Code's own hook execution layer, not by the plugin process itself.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

v2.1.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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