AI coding agents on Windows: native or WSL, agent by agent
Updated
Many AI coding agents run natively on Windows, including Claude Code, Codex, OpenCode, GitHub Copilot, Cursor, Cline and Aider. Check the shell sandbox separately from the installer. Codex, Copilot CLI and Antigravity CLI support sandboxed commands on qualifying Windows installations. Claude Code runs natively, but its command sandbox requires WSL2. Google’s Windows requirements · Claude Code sandbox
So the question for an AI coding agent on Windows isn’t “does it run?” but “where do its commands run, and what can they reach?”
Which agents run natively on Windows?#
| Agent | Install on Windows | Shell it uses | Sandbox on native Windows | Config |
|---|---|---|---|---|
| Claude Code | irm https://claude.ai/install.ps1 | iex or winget install Anthropic.ClaudeCode |
Git Bash plus PowerShell; PowerShell only without Git | No. WSL2 only | %USERPROFILE%\.claude\settings.json |
| Codex (CLI, IDE extension, ChatGPT desktop app) | powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex", or the app from the Microsoft Store |
PowerShell | Yes: MXC on recent Windows 11, or an admin-set-up fallback | %USERPROFILE%\.codex\config.toml |
| OpenCode | Standalone CLI ZIP or desktop installer for x64 and ARM64 | Runs natively | Run inside a container or VM for OS-level isolation | Project opencode.jsonc; opencode debug paths lists global paths |
| GitHub Copilot CLI | winget install GitHub.Copilot or npm install -g @github/copilot |
PowerShell 6 or later | Yes, opt-in: /sandbox enable. Needs a recent Windows 11 update |
%USERPROFILE%\.copilot\settings.json |
| Copilot in VS Code | The GitHub Copilot extension | VS Code’s terminal | Local sandboxing in Agent Host sessions | VS Code settings.json |
| Cursor | Installer from cursor.com | Its built-in terminal | Documented for macOS and Linux only | .cursor\ in the project, %USERPROFILE%\.cursor\ |
| Antigravity CLI | irm https://antigravity.google/cli/install.ps1 | iex |
Windows terminal | Native on Windows 11 24H2 or later with the August 2026 update. Auto mode enables it. In other modes, use /config. |
%USERPROFILE%\.gemini\antigravity-cli\settings.json |
| Cline | VS Code extension, npm install -g cline, or the desktop app (Windows in beta) |
Your editor’s terminal | None documented | .clinerules\ in the project, Documents\Cline\Rules |
| Aider | powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex" |
Your shell, for commands you approve | None | .aider.conf.yml in your home folder, repo root or current folder |
| DeepSeek Harness | npx @deepseek-ai/dsh web (needs Node.js), opens in the browser |
Not stated | Windows not documented | Not stated |
| Contenox Harness | The app from the Microsoft Store | Native | Yes: writes limited to the project; reads can’t be restricted on Windows | The Permissions page in the app |
“Not stated” means the agent’s own docs don’t say, as of November 2026. DeepSeek Harness is a developer preview with breaking changes announced in its README.
Step-by-step pages for the two most common:
- Claude Code on Windows: installers, Git Bash or PowerShell, WSL, settings paths and fixes
- Codex on Windows: desktop app, CLI, sign-in, the Windows sandbox and crash reports
Native or WSL: which should I use?#
Run the agent where your toolchain lives.
| Choose native Windows when | Choose WSL2 when |
|---|---|
| The project builds with Windows tools: .NET, MSBuild, Visual Studio, PowerShell scripts | The project expects Linux: Bash scripts, Makefiles, Docker-first setups |
| You want the agent’s desktop app to just work | You want Claude Code’s sandbox or a Linux toolchain |
Your files live on C:\ and other Windows apps use them |
Your files can live in the Linux file system |
The tradeoffs that decide it in practice:
File system speed. Files on C:\ are reached from WSL through /mnt/c, which is much slower for the thousands of small reads an agent and npm install do. Microsoft’s rule: store files in the WSL file system if you work in a Linux shell, and on the Windows file system if you work in PowerShell. Keep a WSL project at ~/code/my-app, not /mnt/c/Users/you/my-app. Windows apps reach it at \\wsl$\Ubuntu\home\you\code\my-app.
Two homes, two configs. A WSL agent reads ~/.claude or ~/.codex inside Linux, not %USERPROFILE%. Your rules, MCP servers and sign-in don’t carry over. Codex lets you share one: export CODEX_HOME=/mnt/c/Users/<you>/.codex in ~/.bashrc.
PATH leaks across. By default WSL appends your Windows PATH to Linux’s. An agent in WSL can end up running the Windows node.exe or git.exe when the Linux one is missing, with confusing errors. Install the tools inside Linux, or set appendWindowsPath=false under [interop] in /etc/wsl.conf and run wsl --shutdown.
Three shells, three behaviours. An earlier Contenox project, developed mostly on Linux, kept WSL2 for daily work and a native checkout only for verifying paths and shell behaviour, because its shell tool behaved differently under cmd.exe, PowerShell and Git Bash. A command an agent ran fine in one is not proof for the others.
WSL1 is out. Codex dropped it in version 0.115, and Claude Code’s sandbox needs WSL2. Check with wsl -l -v and convert with wsl --set-version <distro> 2.
The line-ending trap#
An agent on Windows and an agent in WSL working on the same checkout disagree about line endings. Windows Git with core.autocrlf=true writes CRLF; Linux tools write LF. The result is a diff where every line of every touched file “changed”, which buries the agent’s real edit and wrecks your review.
Fix it once in the repository, not on each machine. Add a .gitattributes at the root:
* text=auto eol=lf
*.ps1 text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf
Then check what Git actually stored:
git add --renormalize .
git ls-files --eol
i/lf in the first column means the file is stored with LF. A shell script stored with CRLF fails in Bash with $'\r': command not found, a common “the agent broke my script” report.
Other Windows traps#
- Antivirus slows everything down. Microsoft Defender scans files as they are written, and
node_modulesalone holds tens of thousands. A Dev Drive (Windows 11, at least 50 GB, admin rights to create) runs Defender in performance mode for that volume, a safer choice than folder exclusions. It doesn’t help WSL projects, which live in their own virtual disk. - Antivirus locks files mid-install. “The process cannot access the file because it is being used by another process” during an install usually means a scan holds the download. Wait, delete the half-finished download folder, and rerun.
- PowerShell’s execution policy blocks npm installs. Agents installed with npm get
.ps1launchers, which a default policy refuses with “running scripts is disabled on this system”. Use the agent’s own installer, call the.cmdlauncher, or runSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser. - Network shares prompt or fail. Claude Code always asks before commands that touch
\\server\share, because the lookup can send your Windows credentials to that host. Map the share to a drive letter. - Case-only renames. Windows file systems keep the case of a name but ignore it when matching, and Windows notes from an earlier Contenox project warned against relying on case-only differences for that reason. Git for Windows sets
core.ignorecaseto true, so an agent that renamesUtils.tstoutils.tswith a file tool can leave a changegit statusdoesn’t show; rename withgit mv. - A desktop app doesn’t see the shell’s PATH. A GUI client inherits the environment of whatever launched it, not of the terminal where the agent was installed, so an agent that runs fine in PowerShell can be “not found” from an editor or desktop app. The notes from an earlier editor integration hit this with every client; give the full path to the agent’s executable, or start the client from that terminal.
- Two installs of the same agent. npm, WinGet and the native installer can all put an agent on PATH. Run
where.exe claude(orcodex,copilot) and keep one. - No sandbox means your whole account. Without one, an agent’s commands can read
%USERPROFILE%\.ssh,.awsand your browser profiles. Turn the sandbox on where it exists, deny those paths in your rules where it doesn’t, or run the agent in WSL2 or a container. See how to sandbox AI coding agents.
How do I install OpenCode on Windows?#
Choose the Windows x64 or ARM64 CLI ZIP for your machine. Extract it, add its folder to your user Path if you want to call it anywhere, then open PowerShell in your project and run opencode --version followed by opencode. For a graphical interface, choose the Windows desktop installer instead. The official install guide lists both downloads.
In the terminal, use /connect to choose a provider or /models to select an already discovered local model. The web interface runs on the same server. Run opencode pair and open the one-time local link it prints. Keep that link private. Providers · Browser pairing
Contenox Harness#
Contenox Harness is a desktop app built for Windows first, a shape it took after an editor build and a terminal client were both tried and dropped (the editor, the terminal client). Open a project folder, tell an agent what to do, and approve the risky steps; it can use a ChatGPT subscription, Claude through Claude Code, an API key, or a local model. On Windows, a sandbox limits the agent’s writes to the project folder. Reads can’t be restricted on Windows, so the credential stores stay gated or blocked by rule; what runs without asking is a rule set that can be read and changed under Permissions (built-in tools and permissions). Get it from the Microsoft Store.
Related guides#
Claude Code on Windows: full install and setupClaude Code on Windows: install, setup and common fixesInstall Claude Code on Windows 11 from PowerShell, CMD or WinGet, pick Git Bash or PowerShell, decide on WSL, and fix PATH, proxy and duplicate-install errors.
Codex on Windows: desktop app, CLI and the Windows sandboxCodex for Windows: install, desktop app and sandbox setupCodex for Windows, step by step: the desktop app, the CLI from PowerShell, npm or WSL, signing in, the Windows sandbox and its errors, and fixes for crashes.
Best AI coding agents: how the agents compare beyond the platformBest AI coding agents 2026: ranking and comparisonThe best AI coding agents in November 2026, ranked by stated criteria: benchmark results, model choice, Windows support and cost model, with a pick for each need.
Terminal coding agents: what the CLI agents have in commonTerminal coding agents: what they are and which one to useTerminal coding agents explained: how Codex CLI, OpenCode and Claude Code's terminal mode work in a shell, why developers pick them over IDE agents, and when not to.
Why does my coding agent keep asking for permission?: rules for each agentWhy does Claude Code or Codex keep asking for permission?Claude Code, Codex, Copilot or Cursor keeps asking for permission? The real cause in each tool, the exact rule or setting that fixes it, and what to keep asking.
Release notes with AIGenerate release notes with AI from git log, in one commandGenerate release notes with AI: pipe git log into Claude Code, Codex CLI or OpenCode, get grouped Markdown back, and run it in CI. Commands, prompt and the traps.
OpenCode with local modelsOpenCode with local models: Ollama, LM Studio, llama.cpp, vLLMSet up an OpenCode local model: automatic discovery for Ollama, LM Studio and vLLM, plus a llama.cpp configuration, context limits and tool calls.