VS Code Sessions
There are two ways to use VS Code on a compute resource. Both run on the resource itself, so your code, data, and processes stay on the cluster:
| Method | Where it runs | Where you use it | Best for |
|---|---|---|---|
| VS Code session | VS Code server on the resource | Your web browser | Editing and running code with zero local setup |
pw vscode | Your local VS Code app | Your computer | Working in your own VS Code — with all your extensions and settings — connected over SSH |
Looking for a graphical desktop instead? See Desktop Sessions.
The resource must be running
A resource (a compute cluster or your user workspace) must be running before you can launch a VS Code session on it.
VS Code in the browser
A VS Code session runs a VS Code server on the resource and opens it in your browser, so there's nothing to install on your computer.
Launch from a cluster (Quick Launch)
- Open your cluster and find the Quick Launch panel (Open this cluster in your browser).
- On the VS Code card, click Launch.
- (Optional) Set a Directory to open — for example
~/projects. Leave it blank to open your home directory. - Click Launch.
Launch from the Sessions page
- Go to Sessions and click New Session.
- Choose VS Code as the session type.
- Pick the Target resource (a compute cluster or your user workspace).
- (Optional) Set a Directory and a Name.
- Click Launch.
ACTIVATE installs and starts the VS Code server on the resource — you'll see the status move through installing → starting → running. Once it's running, VS Code opens in an embedded view on the session page. Click Open in new tab for a full-window editor.
VS Code sessions work on both compute clusters and your user workspace. For lightweight editing, the user workspace is a quick option that doesn't require starting a cluster.
Connect your local VS Code with pw vscode
If you'd rather work in the VS Code app already installed on your computer — with your own keybindings, themes, and extensions — use the pw vscode command. It connects your local VS Code to the resource using VS Code's Remote-SSH extension, with the connection routed securely through ACTIVATE.
Prerequisites
- The PW CLI installed and authenticated. See About the PW CLI.
- VS Code installed locally with the
codecommand on your PATH. In VS Code, open the command palette (Cmd/Ctrl+Shift+P) and run Shell Command: Install 'code' command in PATH. - The Remote-SSH extension installed in VS Code.
Usage
# Open VS Code on a resource
pw vscode my-cluster
# Open a specific directory
pw vscode my-cluster /home/user/project
# Open VS Code on another user's resource
pw vscode pw://otheruser/their-clusterWhen you run the command, the PW CLI:
- Registers your SSH key with the platform (if it isn't already).
- Writes an SSH host entry to
~/.ssh/pw_config(included from your~/.ssh/config) that proxies the connection through ACTIVATE. - Launches VS Code and connects it to the resource via Remote-SSH, opening the directory you specified — or your home directory by default.
See the pw vscode command reference for the full list of arguments.
Which should I use?
- Use a VS Code session when you want zero local setup — everything runs in the browser.
- Use
pw vscodewhen you want your own local VS Code, extensions, and settings, connected to the resource.