Workspace Trust Blocking Execution Fix (2026)
The Error
[Claude Code Extension] Workspace is not trusted
Cannot execute commands in restricted mode
VS Code Workspace Trust is blocking Claude Code tool execution
Enable trust for this workspace to use Claude Code features
This appears when VS Code’s Workspace Trust feature has the current folder in restricted mode, preventing Claude Code from executing any tools.
The Fix
Cmd+Shift+P > Workspaces: Manage Workspace Trust
> Click "Trust" for the current workspace folder
- Open the VS Code command palette.
- Search for “Manage Workspace Trust”.
- Click “Trust” to grant the workspace full permissions.
- Restart Claude Code in the terminal.
Why This Happens
VS Code’s Workspace Trust feature (introduced in VS Code 1.57) prevents extensions from executing code in untrusted workspaces. When you open a folder for the first time or from an untrusted source (like a downloaded repo), VS Code starts in restricted mode. In this mode, the Claude Code extension cannot execute Bash commands, write files, or run any tools that modify the filesystem. The extension detects restricted mode and refuses to operate.
If That Doesn’t Work
Disable Workspace Trust entirely (only if you trust all code you open):
// VS Code settings.json
{
"security.workspace.trust.enabled": false
}
Add specific folders to the trust list:
// VS Code settings.json
{
"security.workspace.trust.untrustedFiles": "open",
"security.workspace.trust.banner": "never"
}
Run Claude Code from the system terminal instead of VS Code:
# Open Terminal.app or iTerm2 independently
cd /path/to/project
claude
Prevention
# CLAUDE.md rule
Trust this workspace in VS Code before using Claude Code. If prompted about workspace trust, select "Trust" — Claude Code cannot function in restricted mode. Or run Claude Code from a standalone terminal.
See Also
- macOS Gatekeeper Blocking Binary Fix
- Claude Code Workspace Trust Blocks Headless — Fix (2026)
- Workspace Trust Required for Claude Code — Fix (2026)
Related Error Messages
This fix also applies if you see variations of this error:
- Connection or process errors with similar root causes in the same subsystem
- Timeout variants where the operation starts but does not complete
- Permission variants where access is denied to the same resource
- Configuration variants where the same setting is missing or malformed
If your specific error message differs slightly from the one shown above, the fix is likely the same. The key indicator is the operation that failed (shown in the stack trace) rather than the exact wording of the message.
Frequently Asked Questions
Does this error affect all operating systems?
This error can occur on macOS, Linux, and Windows (WSL). The exact error message may differ slightly between platforms, but the root cause and fix are the same. macOS users may see additional Gatekeeper or notarization prompts. Linux users should check that the relevant system packages are installed. Windows users should ensure they are running inside WSL2, not native Windows.
Will this error come back after updating Claude Code?
Updates can occasionally reintroduce this error if the update changes default configurations or dependency requirements. After updating Claude Code, verify your project still builds and runs correctly. If the error returns, reapply the fix and check the changelog for breaking changes.
Can this error cause data loss?
No, this error occurs before or during an operation and does not corrupt existing files. Claude Code’s edit operations are atomic — they either complete fully or not at all. However, if the error occurs during a multi-step operation, you may have partial changes that need to be reviewed with git diff before continuing.
How do I report this error to Anthropic if the fix does not work?
Open an issue at github.com/anthropics/claude-code with: (1) the full error message including stack trace, (2) your Node.js version (node --version), (3) your Claude Code version (claude --version), (4) your operating system and version, and (5) the command or operation that triggered the error.
Related Guides
Configure permissions → Build your settings with our Permission Configurator.
Try it: Paste your error into our Error Diagnostic for an instant fix.