anthropics / anthropics/claude-code

Windows: a console window flashes for every Bash tool call

Open
#94,541 0 comments 0 reactions 0 assignees View on GitHub
area:bash bug platform:windows
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

## Summary

On Windows, a console window appears and disappears for every Bash tool call. During a task that needs many shell commands this becomes near-constant flashing on top of whatever else is on screen.

Codex CLI on the same machine, running comparable shell work, does not do this. That suggests the difference is in how the process is spawned (a hidden-window flag, or reusing a long-lived shell) rather than anything environment-specific.

## Environment

- Claude Code 2.1.234 (2.1.247 present under `bundled-skills`)
- Windows 11 Enterprise, 10.0.26200.9445
- Shell: Git Bash, bash 5.3.15(1)-release
- Node v24.19.0

## Steps to reproduce

1. Start Claude Code in a project on Windows.
2. Give it work that requires many shell commands, for example an investigation that runs dozens of CLI reads and small parsing snippets.
3. Watch the desktop while it works.

## Expected

Shell commands run without painting visible windows.

## Actual

One console window flashes per Bash tool call. A session with several hundred tool calls produces several hundred flashes.

## Notes

- Not specific to any particular CLI being invoked. I verified the npm shim in use is the `sh` variant rather than the `.cmd` one, and it `exec`s node directly with no `cmd.exe` in the chain.
- The presence of `~/.claude/shell-snapshots` suggests a fresh shell process per command, which multiplies the effect versus a single persistent shell.
- Having the agent batch commands into fewer, larger invocations reduces the frequency proportionally, but that is a behavioral workaround rather than a fix.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the Bash tool's process-spawn path and the handling of ~/.claude/shell-snapshots; the report specifically contrasts the npm sh shim with cmd.exe and mentions fresh shells per command. Done means repeated Bash calls on Windows run without painting visible console windows, while preserving the expected shell behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, node.js
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.