Repository navigation
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
Environment
- OS: Windows 11
- Claude Code Version: Latest
- Shell: PowerShell
- Git Bash: Installed (required for Git, not preferred for Claude Code hooks)
Describe the Bug
On Windows, every hook command defined in settings.json is executed via:
/usr/bin/bash --login -i -c <command>
This causes a Git Bash terminal window to visibly pop up on screen every time a hook fires (SessionStart, PostToolUse, statusLine). With multiple hooks configured, multiple bash windows appear simultaneously, stealing focus and disrupting workflow.
This happens regardless of the shell setting in settings.json.
What Should Happen?
Expected Behavior
- Hooks should respect the
shellsetting insettings.json - When
"shell": "powershell.exe"is configured, hooks should run via PowerShell - No unexpected terminal windows should appear during hook execution
- At minimum, hooks should run with
windowsHide: trueto suppress the window
Actual Behavior
Every hook is wrapped in /usr/bin/bash --login -i -c <command>, causing:
- Multiple Git Bash windows popping up simultaneously
- Windows stealing focus during active work
- Poor experience on Windows with PowerShell as preferred shell
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Install Claude Code on Windows with Git Bash installed
- Configure hooks in
settings.json:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "node \"C:/Users/username/.claude/hooks/my-hook.js\""
}
]
}
]
},
"shell": "powershell.exe",
"shellArgs": ["-NoProfile", "-Command"]
}- Start Claude Code
- Observe Git Bash window(s) popping up on every hook execution
Possible Fix
When spawning hook processes on Windows, use the configured shell from settings.json, or at minimum pass windowsHide: true to the Node.js spawn/exec call so the window is suppressed:
spawn(command, args, {
windowsHide: true, // Prevents window popup on Windows
shell: configuredShell || false
})Claude Model
Sonnet (default)
Is this a regression?
Last Working Version
No response
Claude Code Version
2.1.72 (Claude Code)
Platform
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
Additional Context
- Using
get-shit-done-ccGSD plugin with 3 hooks (SessionStart, PostToolUse, statusLine) - All hooks are simple Node.js scripts
- Full node.exe path in commands does not resolve the issue — bash wrapping happens at Claude Code level, before the command is executed
- The
"shell": "powershell.exe"setting works for the terminal but is completely ignored for hook execution
Activity
github-actions commentedon Mar 10, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
ksharma-adeptia commentedon Mar 11, 2026
Workaround for Windows users (reduces popup visibility)
While this issue is open, here's a workaround using AutoHotkey that auto-hides the bash popups. The window still briefly appears but is hidden quickly enough to be avoidable.
Steps
1. Install AutoHotkey
Download and install from https://www.autohotkey.com
2. Create a hide script
Save it as
hide-bash.ahkin your user profile folder.3. Run the script
Double-click
hide-bash.ahk— it runs in the background and auto-hides every bash popup triggered by Claude Code hooks.4. Make it run on startup (optional)
Result
The popup still technically appears for a brief moment but is hidden fast enough that it does not steal focus or disrupt workflow. Not a perfect fix but usable until this is resolved at the Claude Code level.
Environment: Windows 11, PowerShell, Git Bash installed, using
get-shit-done-cchooks (SessionStart, PostToolUse, statusLine)github-actions commentedon Mar 19, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.