# VS Code

> Connect Visual Studio Code to an Occlude session with Remote - SSH and a session certificate. Settings, what Copilot can reach, and what stays off the laptop.

Source: https://occlude.dev/docs/vscode/ · Reviewed 28 November 2026

Open an Occlude session in your own copy of VS Code, with Microsoft's Remote - SSH extension. The file tree, the terminal, the language server and the preview all work as on any remote machine.


## Before you start

- Visual Studio Code with the **Remote - SSH** extension, from Microsoft, used under Microsoft's licence. Occlude does not ship or host either.
- OpenSSH on your machine, and an `ed25519` key. To make one: `ssh-keygen -t ed25519`.
- A session you have been granted. Its grant sets which files you will see and for how long.

## Step one: get a certificate

In Occlude, open the session and choose *Connect an editor*. Paste the contents of `~/.ssh/id_ed25519.pub`. Occlude returns two files to save beside your key, and a `Host` block. The certificate is valid until the session ends.

## Step two: add the host

Add the `Host` block to `~/.ssh/config`. It looks like this, with your session's names:

```text
Host occlude-<session>
  HostName <host>
  Port <port>
  User <session>
  IdentityFile ~/.ssh/id_ed25519
  CertificateFile ~/.ssh/occlude-<session>-cert.pub
  IdentitiesOnly yes
  UserKnownHostsFile ~/.ssh/occlude-<session>.known_hosts
  StrictHostKeyChecking yes
```

`StrictHostKeyChecking yes` with the host key Occlude gave you means your editor connects only to the real workspace.

## Step three: tell VS Code to download on your machine

The workspace has no route to the internet, so the VS Code server and your extensions are downloaded on your machine and sent through the connection. Add to your user `settings.json`:

```json
{
  "remote.SSH.localServerDownload": "always",
  "remote.downloadExtensionsLocally": true
}
```

## Step four: connect

Run **Remote-SSH: Connect to Host** from the Command Palette, choose `occlude-<session>`, then **File > Open Folder** and open the workspace folder. The first connection installs the VS Code server into your home directory in the workspace, which is cleared when the session ends.

## What you see

- The file tree holds your task's files. Folders with nothing you may read are not there.
- Hover over an import from an *Occluded* module and you get its signature. **Go to Definition** opens a declaration that says the module is protected ([see it](https://occlude.dev/demo/#contractor-3)).
- The integrated terminal is on your side of the workspace. `npm run dev` and `npm test` run on the build's side; see [How a build runs](https://occlude.dev/docs/builds/).
- VS Code forwards the dev server's port, so the preview opens on `localhost` in your browser.
- `occlude submit` opens a pull request with your changes.

## Copilot and other extensions

Extensions that work with files, such as language support, linters and GitHub Copilot, run in the workspace on your side, so they see what you see. In VS Code's words, chat "uses the remote project's context and tools while the editor runs on the client machine." Copilot can read and send the files you can read, and nothing else: an *Occluded* file does not exist for it. Copilot's own content exclusion is not needed for that, and GitHub notes it does not apply to "repositories located on remote filesystems".

What Copilot sends to GitHub is decided by your Copilot plan and policies. See [Where your code goes](https://occlude.dev/docs/data-flow/).

## When it ends

When the grant expires or is revoked, the certificate stops working and the window disconnects. No clone was ever on your machine. Files you had open may remain in VS Code's local state, as they would after any remote session.

## Something not working

See [Troubleshooting](https://occlude.dev/docs/troubleshooting/).

## Sources

Vendor pages, last read on 28 November 2026. Each vendor's behaviour can change; their page is the authority.

- [VS Code: Remote Development using SSH](https://code.visualstudio.com/docs/remote/ssh)
- [VS Code: Remote Development FAQ, on the licence](https://code.visualstudio.com/docs/remote/faq)
- [VS Code: remote agent sessions](https://code.visualstudio.com/docs/agents/run/remote-agent-sessions)
- [GitHub: content exclusion](https://docs.github.com/en/copilot/concepts/context/content-exclusion)
