Blog

Claude Code and Codex on Windows: native, WSL or Git Bash

Install Claude Code and Codex on Windows, natively in PowerShell or in WSL 2: the commands, when Git Bash matters, sandboxing, updates and uninstalls.

· 6 min read

Claude Code and Codex both run natively on Windows now, so WSL is optional. For most people the short answer is to install both from PowerShell and add Git for Windows. Pick WSL 2 instead when your repositories already live in Linux, when you need Linux tools, or when you want Claude Code's sandbox, which native Windows does not have.

Every command below comes from Anthropic's Claude Code setup and terminal configuration docs and OpenAI's Codex CLI, Windows and WSL docs, read on 21 November 2026. Both change often, so treat the details as dated. I did not time the installs, and there are no screenshots in this post. I build Starkomand, an app for Mac and Windows that runs coding agents on one canvas, and it comes up only in the last section.

Native Windows or WSL: which should you pick?

Native Windows WSL 2
Where you install PowerShell or CMD Inside the WSL terminal
Claude Code sandbox Not supported Supported
Codex sandbox Codex's own Windows sandbox The Linux sandbox
Where the repository should live Anywhere on your Windows drive In the Linux file system, such as ~/code, not /mnt/c
Settings folder %USERPROFILE%\.claude and %USERPROFILE%\.codex ~/.claude and ~/.codex inside Linux

Native is less to set up and keeps your files where your Windows editor and tools already look. WSL 2 is the better fit when the project builds with Linux tooling, or when you want Claude Code to run commands inside its sandbox. WSL 1 is the wrong choice for both: Claude Code's sandbox needs WSL 2, and Codex dropped WSL 1 in version 0.115.

A native install and a WSL install are two separate programs with separate settings and sign-ins. Which one runs depends on the terminal you type claude or codex into.

How do you install Claude Code on Windows?

Claude Code needs Windows 10 version 1809 or later (or Windows Server 2019), 4 GB of RAM and an x64 or Arm64 processor. You do not need to run the installer as Administrator. Pick one of these, in a new terminal:

# PowerShell
irm https://claude.ai/install.ps1 | iex
:: CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
# WinGet
winget install Anthropic.ClaudeCode
# npm, which needs Node.js 22 or later
npm install -g @anthropic-ai/claude-code@latest

Then run claude --version to check it, and claude to sign in. If PowerShell answers The token '&&' is not a valid statement separator, you pasted the CMD line into PowerShell. Your prompt tells you which one you are in: PS C:\ is PowerShell, a bare C:\ is CMD.

Does Claude Code on Windows need Git Bash?

Not any more, though it is still worth installing. Older docs said native Windows required Git for Windows, which is why so many guides still say so. The current setup page calls it recommended: Claude Code uses Git Bash for its Bash tool and its Monitor tool, and without Git for Windows it falls back to PowerShell as the shell it runs commands in.

Install Git for Windows and Claude Code finds Git Bash by itself. If it does not, point it at bash.exe in your Claude Code settings.json:

{
  "env": {
    "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
  }
}

WSL does not need any of this, because the agent already runs inside Linux there.

How do you run Claude Code in WSL?

Open your WSL distribution's terminal and run the Linux installer there, not in PowerShell:

curl -fsSL https://claude.ai/install.sh | bash

Keep the project in the Linux file system, such as /home/you/code, rather than under /mnt/c. The setup page warns that searches can return fewer matches across that boundary. On WSL 2, Claude Code's sandbox is available; on WSL 1 it is not.

How do you install Codex on Windows?

From a new PowerShell window:

powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

npm works too, with npm install -g @openai/codex. Run codex and choose Sign in with ChatGPT to use your ChatGPT plan, or another sign-in method. Running the same installer again updates it.

Codex brings its own sandbox for native Windows, and OpenAI's docs recommend it over WSL by default. The [windows] table in config.toml picks the mode:

[windows]
sandbox = "elevated" # or "unelevated"

elevated is the one the docs prefer, and it needs a setup step an administrator approves. unelevated is the fallback when that setup is not available and your organization allows it.

For Codex in WSL, install WSL from PowerShell run as Administrator, then install Codex inside it:

wsl --install
wsl
curl -fsSL https://chatgpt.com/codex/install.sh | sh
codex

The Codex desktop app for Windows is a separate download, winget install --id 9PLM9XGG6VKS -s msstore. It uses the native Windows agent by default and can switch to WSL in its settings. The app and the native CLI share %USERPROFILE%\.codex, while the CLI in WSL keeps its own settings in the Linux home folder.

How do you update or uninstall them?

Native Claude Code updates itself in the background. To update by hand, run claude update, or winget upgrade Anthropic.ClaudeCode if you installed it with WinGet. To remove a native install, run these in PowerShell:

Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

winget uninstall Anthropic.ClaudeCode and npm uninstall -g @anthropic-ai/claude-code remove the other installs. Your settings stay in %USERPROFILE%\.claude and %USERPROFILE%\.claude.json until you delete them too.

Codex updates with the same installer command you used to install it, or npm install -g @openai/codex again. An npm install comes out with npm uninstall -g @openai/codex.

Which terminal should you run them in?

Windows Terminal, version 1.25 or later, where Shift+Enter starts a new line in Claude Code without setup. In older versions use Ctrl+J, or type \ and then Enter. The VS Code and Cursor terminals need /terminal-setup once. The best terminal for Claude Code compares them on alerts and split panes too, and covers the Backspace and flicker settings that only matter on Windows.

Running more than one agent on Windows

Once Claude Code and Codex both work, the next problem is the one every multi-agent setup has: several terminals that look alike, and no way to see which one is waiting on you.

Starkomand runs on Windows 10 and 11, x64 or Arm64, from the Microsoft Store. Each CLI you installed runs in its own real terminal window on one canvas, in PowerShell by default. A window's header turns amber with a timer when its agent waits on you, and a saved brief can hand a task from Claude Code to Codex in a fresh window. If you came from cmux on a Mac, cmux for Windows covers what carries over.

The tradeoffs: it is a paid app after 3 free days, not a free terminal, and agents on your own servers (SSH hosts) are not available on Windows yet. If you run one agent at a time, Windows Terminal is all you need.

The Starkomand features in this walkthrough

More walkthroughs: running Claude Code and Codex side by side, Claude Code notifications, and Codex vs Claude Code.

To try several agents on one canvas, start the 3-day trial of Starkomand. It includes every feature, and your agents keep using the subscriptions you already have.