Quickstart Publish your first site with Claude Code

Step 2 · Set up your agent

Windows: allow scripts

Windows blocks PowerShell scripts until you allow them, and Node's tools need them. One setting fixes it for your account. On a Mac? Skip this page.

Time: 3 minVS Code path

What you'd see

You or the agent run npm, Node's tool installer, in the VS Code terminal, and get an error like this:

npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system.

The file named can also be codex.ps1 or claude.ps1. It's the same problem.

Why: on Windows, VS Code's terminal runs Windows PowerShell. Its starting policy, called Restricted, runs single commands but no scripts. npm and the tools it installs start through small .ps1 script files, so PowerShell refuses them.

Fix it

Say this
Allow PowerShell scripts for my user account only using Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force, then check it with Get-ExecutionPolicy -List.

Read the command in the permission prompt, then allow it. It doesn't need admin rights, and it works right away. -Force only skips PowerShell's "are you sure?" question, which the agent can't answer.

What this changes

  • Scripts on your computer can run. Scripts downloaded from the internet still need a signature from a trusted publisher.
  • It applies only to your Windows account. That's why it doesn't need admin rights.
  • It stays set until you change it.

Microsoft explains the settings in about_Execution_Policies (opens in a new tab).

If it goes wrong

It says my setting is overridden by a policy, or nothing changed

On a work or school laptop, your IT department may set this policy for you, and theirs wins. Ask IT to allow it. Don't try to get around it.

What the agent runs for you
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force   # -Force skips the Y/N question
Get-ExecutionPolicy -List

The list looks something like this. The line that matters is CurrentUser:

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser    RemoteSigned
 LocalMachine       Undefined

Saved only in this browser.