claude-code - 💡(How to fix) Fix [DOCS] PowerShell tool docs omit ExecutionPolicy Bypass default and opt-out variable

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/tools-reference#powershell-tool

Section/Topic

PowerShell tool documentation, especially the default process launch behavior and the environment-variable controls for that behavior

Current Documentation

The PowerShell tool section currently says:

The PowerShell tool lets Claude run PowerShell commands natively. On Windows, this means commands run in PowerShell instead of routing through Git Bash. On Windows without Git Bash, the tool is enabled automatically. On Windows with Git Bash installed, the tool is rolling out progressively. On Linux, macOS, and WSL, the tool is opt-in.

On Windows, Claude Code auto-detects pwsh.exe for PowerShell 7+ with a fallback to powershell.exe for PowerShell 5.1. When the tool is enabled, Claude treats PowerShell as the primary shell. The Bash tool remains available for POSIX scripts when Git Bash is installed.

The environment variable reference currently documents:

CLAUDE_CODE_USE_POWERSHELL_TOOL | Controls the PowerShell tool. On Windows without Git Bash, the tool is enabled automatically; set to 0 to disable it. On Windows with Git Bash installed, the tool is rolling out progressively: set to 1 to opt in or 0 to opt out. On Linux, macOS, and WSL, set to 1 to enable it, which requires pwsh on your PATH. When enabled on Windows, Claude can run PowerShell commands natively instead of routing through Git Bash.

No page currently mentions -ExecutionPolicy Bypass or CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY.

What's Wrong or Missing?

Changelog v2.1.143 documents a user-visible PowerShell behavior change:

PowerShell tool now passes -ExecutionPolicy Bypass. Opt out with CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY=1

The current docs do not explain that behavior anywhere.

A. The default PowerShell invocation behavior is undocumented

The PowerShell tool page explains how the tool is enabled and which executable Claude uses, but it does not state that PowerShell tool invocations now pass -ExecutionPolicy Bypass by default.

B. The opt-out control is undocumented

The environment variable reference does not list CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY, so users cannot discover how to restore normal execution-policy handling.

C. The docs leave a policy-sensitive behavior change discoverable only in the changelog

Execution policy affects how PowerShell commands run in managed Windows environments. Without a doc update, users and admins have to infer this behavior from the release notes instead of finding it in the PowerShell tool docs or env var reference.

Suggested Improvement

Update the PowerShell tool section to document the default launch behavior explicitly.

Suggested content:

By default, PowerShell tool commands pass -ExecutionPolicy Bypass.

To make Claude Code respect the system or user PowerShell execution policy instead, set CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY=1.

Also add an environment-variable reference entry for CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY that explains:

  • it applies to PowerShell tool commands,
  • 1 opts out of the default bypass behavior, and
  • it is relevant for Windows environments where execution policy is managed or expected to remain enforced.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageContext
https://code.claude.com/docs/en/tools-reference#powershell-toolPrimary PowerShell tool documentation explains enablement and shell selection, but not the default -ExecutionPolicy Bypass behavior or the opt-out variable
https://code.claude.com/docs/en/env-varsEnvironment variable reference documents CLAUDE_CODE_USE_POWERSHELL_TOOL but not CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY

Total scope: 2 pages affected

Source: Changelog v2.1.143

Exact changelog entry:

PowerShell tool now passes -ExecutionPolicy Bypass. Opt out with CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY=1

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [DOCS] PowerShell tool docs omit ExecutionPolicy Bypass default and opt-out variable