Bash/PowerShell tool fails instantly on Windows — exit code 1, zero stdout/stderr, every command
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 command run through the shell tool fails immediately with exit code 1 and completely empty output (no stdout, no stderr) — including trivial ones like Write-Output "hello" or exit 0. PowerShell itself is confirmed healthy on the machine: the exact same commands run fine when typed manually in a real terminal window, including with -NonInteractive -NoProfile flags that mimic non-interactive invocation. The failure appears to be specific to how the app's own process spawns the child shell, not to PowerShell, execution policy, or the command content.
What Should Happen?
The shell tool should execute the given command in PowerShell and return its actual stdout/stderr/exit code, matching what running the same command manually produces.
Error Messages/Logs
Tool reports only: "Exit code 1" — no stdout, no stderr, no further diagnostic detail is surfaced by the tool for any command, regardless of content.
Steps to Reproduce
- On Windows 11, open a Claude Code session (desktop app, Code tab).
- Run any shell command, e.g.
Write-Output "hello". - Observe: tool reports "Exit code 1" with no stdout/stderr, regardless of command content.
- Confirm PowerShell itself is fine by opening a normal terminal (Win+X → Terminal) and running the identical command directly — it succeeds.
- Confirm non-interactive invocation also works outside the app:
powershell.exe -NonInteractive -NoProfile -Command "Write-Output 'hello'"succeeds when run manually.
What we ruled out:
- Execution policy:
Get-ExecutionPolicy -ListshowsBypassat LocalMachine, all other scopes Undefined — not a policy block. - Sandbox flag: fails identically with the tool's sandbox-disable option on or off.
- Execution mode: fails identically in foreground and background modes.
- App state: persisted through full app restart, full uninstall/reinstall, and full machine reboot.
- Security software: personal (non-managed) device, Smart App Control off, no third-party AV/EDR beyond built-in Windows Defender.
- Working directory: confirmed accessible — file tools (Read/Write/Edit/Glob/Grep) work fine; only process execution fails.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Windows 11 Home 10.0.26200
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_