[BUG] Hook processes flash visible console windows on Windows when Claude Code runs inside WebStorm terminal (ConPTY)

Resolved 💬 2 comments Opened Jun 2, 2026 by malaareda Closed Jun 5, 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?

Every time a new Claude Code session starts, 2 brief flashing console windows appear on screen while hooks execute. The same setup in Windows Terminal (ConHost) produces zero flashes — confirming this is a
ConPTY-specific issue.

What Should Happen?

---
Expected Behavior

Hook processes run silently in the background with no visible console windows, regardless of which terminal emulator is used.

---
Actual Behavior

Each hook process spawned by Claude Code allocates a new visible Windows console window (ConHost) that flashes briefly on screen. This happens because:

  1. WebStorm's terminal uses ConPTY as its terminal emulation layer
  2. When Claude Code spawns hook child processes inside a ConPTY session, it does not pass the CREATE_NO_WINDOW process creation flag (equivalent to Node.js windowsHide: true)
  3. Windows, unable to attach the child process to the ConPTY, allocates a new standalone console (ConHost) for each child — causing the visible flash
  4. In Windows Terminal (ConHost), child processes inherit the console normally — no new window is allocated, no flash

Error Messages/Logs

Investigation done

We audited every hook script and setting looking for the cause:
- Eliminated all bash shell calls from hooks (replaced with direct node calls)
- Eliminated all node --import tsx/esm TypeScript hooks (converted to plain .mjs)
- Added windowsHide: true to every internal spawn() call inside hook scripts
- Confirmed all SessionStart hook commands are now plain node script.mjs calls

Despite all the above, flashes persist — confirming the issue is not in our hook scripts but in how Claude Code's hook runner spawns child processes at the OS level.

Steps to Reproduce

  1. Open any project in WebStorm on Windows 11
  2. Open the integrated terminal (WebStorm uses ConPTY on Windows)
  3. Run claude to start a new session
  4. Observe: 2 console windows flash and disappear during SessionStart hook execution

Control test: Run the exact same claude command in Windows Terminal — zero flashes.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.152 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

---
Suggested Fix

In Claude Code's hook runner, add windowsHide: true (Node.js child_process.spawn option) when spawning hook processes on Windows:

// Claude Code hook runner (approximate fix location)
const child = spawn(cmd, args, {
stdio: ['ignore', 'pipe', 'pipe'],
windowsHide: true, // ← add this line
// ... rest of options
})

windowsHide: true maps directly to the Win32 CREATE_NO_WINDOW process creation flag. It prevents the console window allocation while still allowing stdout/stderr to be captured via pipes — no functionality is lost.

---
Impact

Affects all Claude Code users on Windows who run inside WebStorm (or any JetBrains IDE), which uses ConPTY. The flashing windows are distracting during focused development work and appear on every session start and potentially during tool use hooks.

View original on GitHub ↗

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