Claude Code Permission Errors on Windows: Common Fixes
A Claude Code permission error on Windows usually means Windows, PowerShell, or security software blocked a read, write, or run step before Claude Code could finish. The safest first fix is to move the project to a normal folder you own, reopen your terminal, and try again. If that does not work, check folder ownership, OneDrive, Defender, and PowerShell execution policy.
What the error is really saying
Claude Code permission errors on Windows usually fall into one of three buckets: filesystem access, shell policy, or Windows security controls.
If you see Access is denied, EPERM, or EACCES, Claude Code could not read or write a file or folder. That usually means the path is protected, the folder is owned by another account, or security software blocked the write.
If PowerShell says a script cannot be loaded because running scripts is disabled, that is not a folder permission problem. It means the shell stopped the command before Claude Code could run.
If a command starts but Claude Code cannot create files, edit files, or run a helper step, the issue is often Windows Defender, Controlled Folder Access, OneDrive sync, or a path inside a protected location.
The exact message matters because it tells you where to look first. A write failure points at the folder. A script-execution message points at PowerShell. A blocked action with no obvious shell error often points at Windows security software.
Before you start
This applies to Claude Code on Windows when you run it from PowerShell, Command Prompt, or Windows Terminal. You may need Administrator privileges only if you are changing folder ownership, folder permissions, or Windows Security settings; start with a normal terminal first.
No restart or backup is required for the first checks. A safe first pass is to confirm the project is in a folder you own and to compare the exact error text before you change permissions or security settings.
- Check whether the project is under your user profile, such as
C:\Users\YourName\dev\project. - Check whether the terminal you’re using is the same one you used when Claude Code last worked, and whether it is running normally or as Administrator.
Symptom
Access is denied
EPERM
EACCES
The script cannot be loaded because running scripts is disabledError
These are the common permission-related messages, but the exact message varies. The error usually appears when Claude Code tries to read, write, or run something in a folder Windows is protecting, or when PowerShell blocks the command before Claude Code starts.
Where this usually happens on Windows
These are the most common places and setups that trigger permission trouble:
C:\Program Filesor other system foldersC:\Windows- A project inside OneDrive, especially if sync is active
- Protected user folders such as
Documents,Desktop, orPictureswhen Controlled Folder Access is on - A folder created by another account or an elevated installer
- A terminal opened in one context and then reused in another, such as normal user versus Administrator
Before you change anything, check two safe things first:
- Is the project inside a normal folder you own, like
C:\Users\YourName\dev\project? - Are you using the same account and the same terminal you used to install and run Claude Code?
If the answer to either one is no, that is often enough to explain the error.
The first fix to try
Start with the least risky fix: move the project to a folder that your user account clearly owns, then reopen your terminal and run Claude Code again.
- Move or copy the project to a path like
C:\Users\YourName\dev\project. - Close PowerShell, Windows Terminal, or Command Prompt completely.
- Open a fresh terminal normally, not as Administrator.
- Change into the project folder.
cd C:\Users\YourName\dev\projectPowerShell
- Run the same Claude Code command again.
If it works in the new folder, the problem was almost certainly the old location, not Claude Code itself. If it still fails with the same permission message, the next places to check are Windows security tools and folder permissions.
Check Windows Defender, Controlled Folder Access, and antivirus
Windows security software can block file creation or editing without making the reason obvious. Controlled Folder Access is the main Windows feature to check if Claude Code can read a project but cannot save changes.
Open Windows Security and look at ransomware protection settings. If Controlled Folder Access is on, it may need an allow rule for the terminal you use, such as powershell.exe, WindowsTerminal.exe, or cmd.exe, depending on how you run Claude Code.
Windows Security > Virus & threat protection > Ransomware protection > Manage ransomware protectionSettings path
If you use third-party antivirus, check its quarantine, protection history, or app-control settings for a blocked terminal or Node process.
A safe test is to add a trusted exception only for the folder you use for development, or only for the terminal app you trust. Keep the exception as narrow as possible. If allowing the terminal immediately fixes the problem, you have a security-rule issue, not a Claude Code bug.
Make sure your terminal can actually write to the folder
If the folder looks normal but writes still fail, check ownership and inherited permissions. The current user needs modify rights on the project folder and, in many cases, on the parent folder too.
You can inspect the folder from File Explorer, then open Properties and look at Security. Your account should appear there with write or modify access.
Right-click folder > Properties > SecuritySettings path
If the folder was created by another account, by an installer, or by an elevated prompt, Windows may have kept ownership or permissions that block your normal terminal session. In that case, run Claude Code from a folder under your own user profile, or fix the folder permissions so your account has write access.
If the command works in C:\Users\YourName\dev but not in the original folder, the original path is the problem. If it fails everywhere, the issue is probably not folder ownership alone.
If the error mentions scripts or execution policy
When PowerShell says scripts are blocked, the problem is usually execution policy, not file permissions. Claude Code can be installed correctly and still fail if PowerShell refuses to run the startup script or helper command.
First, confirm the exact message. A script block warning usually mentions cannot be loaded or running scripts is disabled. That is different from Access is denied.
Check the current policy in the terminal you actually use:
Get-ExecutionPolicyPowerShell
If the policy is restrictive, you may need to run Claude Code from a shell that is allowed to execute the required command, or adjust the policy for your user account if your environment allows it.
If you are on a managed work machine, group policy may override your setting. In that case, a policy change may not stick, and the fix has to come from your IT settings or from using a different approved shell. If the error is about a script file path, do not treat it like a folder write issue.
How to tell whether the problem is Claude Code, your shell, OneDrive, Defender, or a restricted path
Use the error wording and the place where it fails to separate the likely causes.
- If the terminal complains before Claude Code starts, the shell is the problem.
- If Claude Code starts but cannot read or write files in one folder, the path or folder permissions are the problem.
- If the project works outside OneDrive but fails inside it, OneDrive sync is a likely cause.
- If the folder is writable but a save or edit is blocked, Defender or Controlled Folder Access is a likely cause.
- If the same command works in one directory and not another, compare the two paths first.
A quick rule of thumb: Access is denied, EACCES, and EPERM usually point to folder or security restrictions. A message about scripts being disabled points to PowerShell. A missing-file or path-not-found message points somewhere else entirely.
How to verify the fix worked
Use a clean folder you know you can write to, then repeat the same Claude Code action that failed before. The goal is to confirm both read and write access, not just that the command launches.
- Create or choose a simple test folder under your user profile.
- Open a fresh terminal in that folder.
- Run the same Claude Code command again.
cd C:\Users\YourName\dev\claude-testPowerShell
If the fix worked, Claude Code should get past the earlier permission stop and no longer show Access is denied, EACCES, EPERM, or a script-block message. If it still fails, compare the exact error text to the earlier one. A changed error usually means you fixed one layer and exposed the next.
How to prevent this the next time you set it up
The easiest way to avoid repeat permission problems is to keep your projects in folders you own and to use one terminal consistently.
- Put projects under something like
C:\Users\YourName\dev - Avoid
Program Files,Windows, and other protected locations - Be careful with OneDrive if it syncs your working folders
- Stick to one account for installs and daily use
- Open a fresh terminal after changing security settings or permissions
- Keep a note of which shell you use for Claude Code so you do not mix normal and elevated sessions
If you routinely work across multiple machines, keep the project path and shell choice as consistent as you can. That reduces the chance that Windows applies a different rule on the next setup.
When the problem is not permissions at all
Some errors look like permission trouble but are caused by something else.
If Claude Code says Node or Git is missing, that is an environment problem, not a write-permission problem. If the path cannot be found, the folder may not exist or the command may be pointing at the wrong location. If the command syntax is wrong, PowerShell may show a parser or argument error that has nothing to do with access.
A quick clue: if the message mentions not recognized, cannot find path, or a missing dependency, stop chasing permissions and fix the setup issue first. If the command runs in one folder but not another, permission or security controls are still the likely cause.
If you are unsure, copy the exact error text and compare it to the three buckets above: folder access, script blocking, or missing tools.
Conclusion
Try the same Claude Code command again in a folder under your user profile with a fresh terminal session. If that works, keep your projects there and avoid protected folders going forward. If it still fails, the exact error text will tell you which layer to fix next: shell policy, folder access, or Windows security controls.
Frequently Asked Questions
Why does Claude Code work in one folder but not another on Windows?
That usually means the failing folder has different permissions, is protected by Windows security features, or sits in a location like OneDrive or Program Files that blocks writes more often.
Should I always run PowerShell as Administrator for Claude Code?
No. Start with a normal terminal first. Running as Administrator can hide the real problem and is usually not needed unless a specific setup step requires it.
How do I know if Defender is blocking Claude Code?
If the command can start but file writes fail, or if it works after you add a trusted exception for the terminal or project folder, Defender or Controlled Folder Access was likely involved.
What exact error text should I look for?
Common ones are `Access is denied`, `EPERM`, `EACCES`, and PowerShell messages about scripts being disabled. Those point to different fixes, so the wording matters.