Fixing VS Code Workspace Trust Prompts That Silently Block Extensions and Tasks in a Freshly Cloned Repo
A repo that was just cloned opens in VS Code looking completely normal, but the debugger won't launch, a task defined in tasks.json does nothing when run, and an extension that was working fine in every other project stays stuck inactive — with no error dialog pointing at the actual cause. Workspace Trust, restricting what a folder VS Code doesn't yet trust is allowed to run, is usually the reason, and it fails silently by design.
The Problem
A repository is cloned — from a URL pasted into VS Code's "Clone Repository" command, from a CI artifact, or copied in from a cloud dev environment — and VS Code opens it looking entirely ordinary. Files are visible, syntax highlighting works, and the file explorer behaves normally. But the debugger refuses to start when F5 is pressed, a build task defined in tasks.json runs and immediately exits without doing anything, and an extension like ESLint or a language server that normally activates automatically stays greyed out in the extensions view. No error dialog explains why; the features in question simply don't do anything.
Why It Happens
Workspace Trust restricts what an "untrusted" folder is allowed to do, specifically to protect against malicious code execution from an unfamiliar repository
VS Code's Workspace Trust feature, prompted the first time a folder is opened that VS Code hasn't seen a trust decision for, exists to prevent a cloned repository from silently running arbitrary code — a plausible attack vector, since a repo's own tasks.json, debug configuration, or workspace settings can define commands that execute automatically. Choosing "Restricted Mode" (or simply dismissing the prompt without an explicit choice, which defaults to restricted) disables exactly the categories of functionality this issue describes, as the security boundary working as intended.
Restricted Mode disables task execution, debugging, and most extension activation — specifically the things an untrusted repo could use to run code
In Restricted Mode, tasks defined in tasks.json don't run, launch configurations in launch.json are blocked from starting a debug session, and many extensions — particularly ones that execute project-defined scripts, linters, or language servers against the folder's own configuration — either don't activate at all or activate in a deliberately limited mode. This is a broad, blanket restriction rather than anything tied to a specific file or setting, which is why the symptoms span debugging, tasks, and extensions simultaneously rather than looking like one isolated bug.
The trust prompt is easy to miss or accidentally dismiss, especially in automated or headless-adjacent workflows
A workspace opened programmatically, through a remote/SSH connection, inside a dev container, or quickly during a context switch between several repos can have its trust prompt appear and get dismissed (or simply go unnoticed in a background window) without the "Trust" option ever being explicitly clicked — leaving the folder in Restricted Mode indefinitely, with nothing in the UI afterward actively reminding that this state is still in effect.
The Fix
1. Check the actual trust state directly rather than guessing from the symptoms
Command Palette -> "Workspace: Manage Workspace Trust"
(The status bar's shield icon, when present, also indicates restricted mode.)
This command opens a dedicated view stating plainly whether the current workspace is trusted or restricted, which settles the question directly instead of inferring it from which features happen to be broken — a far more reliable first step than trying to diagnose the debugger, the task, and the extension as three separate problems.
2. Explicitly trust the folder once it's confirmed to be a legitimate, intentionally opened repository
Command Palette -> "Workspace: Manage Workspace Trust" -> "Trust Workspace"
For a repo that was deliberately cloned and is genuinely intended to be worked on — the overwhelming majority of cases this issue actually comes up in — explicitly granting trust is the correct and complete fix, immediately restoring tasks, debugging, and extension activation without needing to change any project configuration.
3. For folders that will always be trusted automatically — a personal projects directory, a dev container's workspace mount — configure trusted locations ahead of time
// settings.json
"security.workspace.trust.untrustedFiles": "open",
"security.workspace.trust.startupPrompt": "never",
// Or, more targeted — pre-trust specific parent folders:
"security.workspace.trust.uriTrustedPaths": [
"/home/user/projects"
]
For a development setup where every folder under a known, controlled parent directory is inherently trusted — a common pattern in personal environments or pre-configured dev containers — declaring that parent as a trusted path removes the prompt (and the risk of it being silently dismissed) for every project cloned underneath it going forward, rather than re-trusting each repo individually.
4. In CI, remote, or container workflows where no human is present to click "Trust," set trust non-interactively as part of the environment's own setup
// .vscode/settings.json or a dev container's devcontainer.json customizations,
// for environments where the workspace itself is already a controlled,
// known-safe context (e.g. a container built from the project's own Dockerfile):
"security.workspace.trust.enabled": false
Disabling Workspace Trust entirely is appropriate specifically for environments that already provide an equivalent security boundary another way — an ephemeral container built fresh from the project's own trusted configuration, for instance — rather than for a general-purpose development machine where the feature's protection against an arbitrary untrusted clone still matters.
Why This Works
None of these symptoms are a bug in the debugger, the task runner, or the extension individually — they're all downstream of the same single state, Restricted Mode, doing exactly what it's designed to do. Checking the actual trust state directly rather than debugging each symptom in isolation, explicitly trusting a repo that's genuinely meant to be worked on, pre-trusting known-safe parent locations, and disabling the feature only where an equivalent security boundary already exists all resolve the same root cause rather than working around its individual effects one at a time.
Conclusion
A freshly cloned repo where the debugger, tasks, and extensions all silently stop working is very often Workspace Trust in Restricted Mode, not three unrelated failures. Checking the trust state directly, explicitly trusting a legitimate repo, pre-configuring trusted locations for routinely-safe folders, and disabling the feature only in environments with an equivalent safeguard already in place turns a confusing multi-symptom mystery into a one-command fix.
