[Windows] Option to suppress console windows for child processes spawned by the CLI (Bash tool, npm/npx, plugins)

Resolved 💬 2 comments Opened Jun 3, 2026 by Lukshm Closed Jun 7, 2026

Environment

  • OS: Windows 11 Pro (10.0.26200)
  • Claude Code CLI: native signed binary at C:\Users\<user>\.local\bin\claude.exe
  • Shells in use: PowerShell + Git Bash; npm/npx; a third-party plugin (claude-mem)

Problem

On Windows, child processes the CLI spawns flash a visible console window. Live process inspection shows the offending spawns are:

  • cmd.exe /d /s /c <script> from npm run
  • bash.exe -c ... from the Claude Code Bash tool
  • npx invocations
  • plugin subprocesses (e.g. claude-mem)

When running Claude Code in a headless / agent-fleet style (repeated tool invocations), these windows flood the desktop continuously and make the machine hard to use.

What I ruled out

  • No Claude Code setting or CLAUDE_* env var appears to suppress spawned console windows (checked ~/.claude/settings.json and the documented env surface).
  • The downstream spawners are outside user control: npm's cmd.exe shell-out has no windowsHide knob; the native claude.exe can't be patched/re-signed (and would be overwritten on auto-update).
  • No OS-wide "hide all consoles" setting exists; per-process wrappers (nircmd / RunHiddenConsole) are fragile against transient children.

Requested feature

A first-class way for the CLI to create child processes with the window hidden on Windows. Any of:

  1. A setting (e.g. settings.jsonwindowsHideConsole: true) and/or env var (CLAUDE_WINDOWS_HIDE_CONSOLE=1) that makes the CLI pass windowsHide: true (Node child_process) / CREATE_NO_WINDOW to all processes it spawns — including the Bash tool, npm/npx, and plugin subprocesses.
  2. Defaulting to windowsHide: true for internal spawns on Windows, since a visible console is rarely desired for tool-driven subprocesses.
  3. Guidance / an API for plugins to inherit a hidden-window spawn policy.

Impact

High for headless / agent-fleet usage on Windows: without this, the desktop is unusable during active agent work. A native option here is the durable fix; local wrappers are brittle and break on auto-update.

View original on GitHub ↗

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