CLAUDE_CODE_USE_POWERSHELL_TOOL

Updated by

CLAUDE_CODE_USE_POWERSHELL_TOOL turns the PowerShell tool on or off, so Claude can run PowerShell commands natively instead of through Git Bash. Default: on for Windows without Git Bash; on for claude.ai and Console accounts on Windows with Git Bash; off elsewhere. Values: 1, true, yes or on turns it on; 0, false, no or off turns it off (case-insensitive); on macOS, Linux and WSL only an on value enables it. Added between v2.1.79 and v2.1.83 and still present in v2.1.332. It is listed in the official reference.

StatusPresent in v2.1.332
AddedAdded between v2.1.79 and v2.1.83
Defaulton for Windows without Git Bash; on for claude.ai and Console accounts on Windows with Git Bash; off elsewhere
Values1, true, yes or on turns it on; 0, false, no or off turns it off (case-insensitive); on macOS, Linux and WSL only an on value enables it
CategoryShell and tools
Official docsListed
Checked againstv2.1.330

How to set it

For one session, export it in the shell that starts Claude Code:

export CLAUDE_CODE_USE_POWERSHELL_TOOL=1
claude

1 turns the tool on in macOS or Linux sessions that have pwsh on PATH.

To apply it to every session, add it to the env object of a settings file:

// ~/.claude/settings.json
{
  "env": {
    "CLAUDE_CODE_USE_POWERSHELL_TOOL": "1"
  }
}

Known issues

  • On Windows without Git Bash, 0 leaves no shell tool, and Claude Code exits at startup with 'Claude Code on Windows requires a shell tool'. Source: docs: tools reference.
  • On Windows with Git Bash, a server-side rollout turned the tool on without notice and told the model the shell was PowerShell, which caused wrong-syntax retries in bash-based setups. Set 0 to keep Bash only. Source: issue #64253.
  • The variable controls the tool Claude calls, not the shell for ! commands. In the Desktop app on Windows, ! commands still open PowerShell with 0 set. Source: issue #93662.

Release notes that mention it

Related variables

Frequently asked questions

What does CLAUDE_CODE_USE_POWERSHELL_TOOL do?

Turns the PowerShell tool on or off, so Claude can run PowerShell commands natively instead of through Git Bash.

What is the default value of CLAUDE_CODE_USE_POWERSHELL_TOOL?

On for Windows without Git Bash; on for claude.ai and Console accounts on Windows with Git Bash; off elsewhere.

What values does CLAUDE_CODE_USE_POWERSHELL_TOOL accept?

1, true, yes or on turns it on; 0, false, no or off turns it off (case-insensitive); on macOS, Linux and WSL only an on value enables it.

Which Claude Code version has CLAUDE_CODE_USE_POWERSHELL_TOOL?

Added between v2.1.79 and v2.1.83 and still present in v2.1.332.

How do I set CLAUDE_CODE_USE_POWERSHELL_TOOL?

Export it before starting Claude Code (export CLAUDE_CODE_USE_POWERSHELL_TOOL=1), or add it to the "env" object in ~/.claude/settings.json to apply it to every session. 1 turns the tool on in macOS or Linux sessions that have pwsh on PATH.

All variables, searchable: Claude Code environment variables.