A hands-on guide to giving a coding agent its own Windows machine: copy the working tree over SSH with tar, pin the SDK in global.json, and let Claude Code run dotnet test there before you push.
Key points
- `git ls-files`, `tar` and `ssh` copy the working tree, uncommitted changes included, with no commit or push.
- `Add-WindowsCapability` installs OpenSSH.Server; an Administrators account must use `C:\ProgramData\ssh\administrators_authorized_keys`.
- `ssh -o BatchMode=yes` turns every prompt into an error, so the agent never hangs on a password or host key.
- A `global.json` with SDK `10.0.300` and `"runner": "Microsoft.Testing.Platform"` fixes both SDK drift and the xUnit v3 runner error.
- The wrapper script wipes the remote copy first and sets `DOTNET_NOLOGO=1` plus `DOTNET_CLI_TELEMETRY_OPTOUT=1` in `cmd.exe`.
- An allow rule for `run-on-windows.sh:*` in `.claude/settings.json` lets the agent run the script without confirmation.
Why it matters
If you develop on macOS or Linux but ship to Windows, the slowest part of the day is the wait after each CI failure. Handing an agent a Windows box over SSH removes the guesswork, but it widens what the agent can break: a model told to make CI green will happily add an `OperatingSystem.IsWindows()` guard. The skill's rules matter more than the tar pipe.
Before adopting, verify the remote machine has the SDK you pin in global.json — this sample needed 10.0.300 plus the Microsoft.Testing.Platform runner for xUnit v3 — and that the authorized_keys path matches the Administrators rule. Budget about 15 seconds per run: the script wipes and rebuilds the remote copy.
Real-world use
- A change whose tests all pass on macOS or Linux but fail in the Windows CI job
- Work touching file paths, file names, line endings, file sharing, processes or the registry, where Windows behaves differently
- Iterating on one failure by running only that class on Windows with `dotnet test --filter-class`
This summary was generated by the agent from the original post on Gérald Barré (Meziantou's blog). The full text and all rights belong to its author and publisher. Go to original