[Windows] Visible console window flashes on every tool use in v2.1.143
Environment
- OS: Windows 11
- Claude Code version: 2.1.143 (upgraded from 2.1.123)
- Terminal: Git Bash inside VS Code integrated terminal
- Hooks configured: Multiple PreToolUse / PostToolUse hooks (Python-based)
Description
After upgrading from v2.1.123 to v2.1.143, a visible (rather large) console-like window briefly flashes on screen with every tool execution (Bash, Read, Edit, etc.). The window appears for less than 0.5 seconds and immediately disappears, but it occurs on every operation, creating noticeable visual noise during active sessions.
Task Manager observation reveals that claude.exe child processes are being spawned and terminated repeatedly during tool execution.
This behavior did not occur in v2.1.123.
Steps to reproduce
- Use Claude Code v2.1.143 on Windows
- Configure any PreToolUse / PostToolUse hooks (
~/.claude/settings.json) - Execute any tool (Bash, Read, Edit, etc.)
- Observe a brief window flash on screen
- Open Task Manager → observe
claude.exechild processes appearing/disappearing in process history
Expected behavior
v2.1.123 and earlier: hook execution happens transparently with no visible windows on screen.
Actual behavior
v2.1.143: claude.exe spawns visible child processes for hook execution, causing the console window to flash briefly.
Likely cause
The new hook execution architecture (apparently spawning claude.exe child processes for sandboxed hook execution) appears to be missing the CREATE_NO_WINDOW flag (0x08000000) on Windows process creation.
Impact
- Visual distraction during active work
- Process history accumulation in Task Manager
- Particularly noticeable for power users with multiple hooks (PreToolUse + PostToolUse fire 3–4 times per tool use)
Suggested fix
Add CREATE_NO_WINDOW flag to the subprocess creation flags when spawning child claude.exe processes for hook execution on Windows. Alternatively, use subprocess.STARTUPINFO with wShowWindow = SW_HIDE.
Workaround
Rolling back to v2.1.123 eliminates the issue, but loses subsequent security and feature improvements.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗