OmniscioGuidesDenying Bash turns off PowerShell
Claude Code: denying Bash turns off the PowerShell tool
Last checked against Anthropic's documentation on November 22, 2026. By the Omniscio team. Updated .
What is the exact message?
Denying Bash also turns off the PowerShell tool, so Claude has neither. To use PowerShell, set CLAUDE_CODE_USE_POWERSHELL_TOOL=1.In non-interactive mode with text output, Claude Code prints this warning on stderr at startup. An interactive session writes it only to the debug log; run with --debug to capture that log at ~/.claude/debug/<session-id>.txt.
In a background session, or with --output-format json or stream-json, Claude Code writes the warning to the debug log instead of stderr.
Before v2.1.287, Claude Code turned the PowerShell tool off the same way without printing a warning. Before v2.1.305, an interactive session printed the warning on stderr at startup too.
What does it mean?
Claude Code gives Claude a shell to run commands. On Windows with Git Bash installed it has two: the Bash tool and the PowerShell tool.
Deny the whole Bash tool and that link turns the PowerShell tool off too, so the session starts with no shell at all. Claude can still read and edit files, but it cannot run a command.
The warning is not saying your deny rule was ignored. It is saying the rule reached further than the Bash tool.
How do I fix it?
Pick one of these two routes.
- If you did not mean to block the whole Bash tool, change that rule. The bare
Bashentry is what turned the PowerShell tool off. Replace it with scoped rules such asBash(git push *)in the same settings file or the flag you used: Claude keeps the Bash tool, and the PowerShell tool stays off until you also set the variable or add a scopedPowerShellpermission rule. - If you want to keep your Bash deny rule, set the variable. Add
CLAUDE_CODE_USE_POWERSHELL_TOOLto theenvblock of a settings file, or to your environment. The block maps variable names to string values, so the value is quoted:"env": { "CLAUDE_CODE_USE_POWERSHELL_TOOL": "1" }. The PowerShell tool then stays on alongside your Bash deny rule.
The difference is what you are blocking. The variable route keeps PowerShell available; the scoped-rule route keeps Bash available for everything the rules do not name.
How do I know it worked?
- Claude runs a command and answers with its output, instead of reporting that it has no shell.
- The startup warning no longer appears on stderr, or in the debug log for an interactive or background session.
- The command you meant to block is still refused, if you narrowed the rule rather than restoring the whole tool.
Where these answers come from
- Anthropic's error reference, Denying Bash also turns off the PowerShell tool, read November 22, 2026: the message, where it is printed, both ways forward, and the v2.1.287 and v2.1.305 changes.
- Bash deny rules also turn off the PowerShell tool and Enable the PowerShell tool, which the same entry points to for the tool-side detail.
Common questions
Why does denying Bash turn off the PowerShell tool?
On Windows with Git Bash installed, denying the whole Bash tool also turns the PowerShell tool off, so the session starts with no shell tool. Anthropic documents that link between the two tools.
How do I keep PowerShell with a Bash deny rule?
Set CLAUDE_CODE_USE_POWERSHELL_TOOL to 1 in your environment or in the env block of a settings file.
How do I block only some Bash commands?
Replace the bare Bash entry with scoped rules such as Bash(git push *). Claude keeps the Bash tool, and the PowerShell tool stays off until you also set the variable or add a scoped PowerShell permission rule.
Where do I see the warning?
On stderr at startup in non-interactive text mode. An interactive session writes it only to the debug log, and so does a background session or json output.