Couch Remote
Control Run & Debug and Source Control of VS Code from your phone, tablet or another computer. Start and step
through debug sessions, follow the debug console, review diffs, commit and push, without walking back to your desk.
The extension runs a small web server inside VS Code and serves a mobile-friendly page to the devices you connect.
Changes show up on the page as they happen.

Features
Run & Debug
- The launch configurations and compounds of every workspace folder. Start each one with Debug, or Run it without debugging.
- Running sessions, including child sessions such as the Node.js processes that the JavaScript debugger starts.
- Continue, pause, step over, step into, step out, restart and stop.
- When a session is paused: the reason and the call stack. Tap a frame to browse its scopes and variables.
- The debug console of each session, live, and an input to evaluate expressions in the paused frame.
Source Control, through VS Code's built-in Git extension
- Branch, upstream and ahead/behind counts. Fetch, pull and push; the first push of a branch sets its upstream.
- Staged, unstaged and merge changes. Stage, unstage and discard one file or all of them.
- Tap a file to see its diff, with line numbers.
- Commit with a message. If nothing is staged, you can stage everything and commit.
- Switch branches, or create a branch from the current HEAD.
- Several repositories in one window.
Every VS Code window
- One URL controls all VS Code windows on your computer. Pick the window at the top of the page; each entry shows
whether a session is running or paused, and how many changes it has.
On any device
- On phones, a tab bar at the bottom and large touch targets keep everything within reach of your thumb. Add the page
to your home screen to open it like an app.
- In desktop browsers, Run & Debug and Source Control sit side by side, and VS Code's debug keys work: F5 continues,
F6 pauses, F10 steps over, F11 steps into and Shift+F11 steps out. Ctrl+Enter (⌘+Enter on a Mac) commits, and ↑ and ↓
bring back expressions you evaluated.
- The page looks like VS Code: it uses the colors of the Light Modern and Dark Modern themes and follows the device's
light or dark setting.
- A banner tells you when the connection to VS Code is lost or the server was stopped, and the page reconnects as
soon as you bring it back to the front on your phone.

Installation
Install from the Visual Studio Marketplace,
or search for Couch Remote in the VS Code Extensions view.
Getting started
- Open the Couch Remote view in the Activity Bar (the sofa) and click Start Server.
- Click Show QR code and scan it with your phone's camera, or use Copy URL and open the URL on the other device.
The device must be on the same network as your computer; see Access from outside your network.
- Control VS Code from the page. Add
&tab=scm to the URL to open the Source Control tab directly.
The URL contains the access token after #token=. The page stores the token on the device and removes it from the
address bar. You can add the page to your phone's home screen; if it asks for the token there, paste the URL from
Copy URL.
The status bar shows whether the server runs and how many devices are connected. Click it to open the Couch Remote view.
The Couch Remote view
- Whether the server runs, whether this window hosts it, and how many devices are connected. Start and stop it here.
- The addresses of this computer, with a QR code, Copy URL and Open in Browser. The QR code stays hidden until
you click Show QR code, because it contains the token (think of screen sharing).
- The VS Code windows that are available through the server.
- Start with VS Code (the
couchRemote.autoStart setting), Regenerate token, Settings and Show log.
Several VS Code windows
The first window that starts the server owns the port; it is the hub. Every other window joins it automatically:
- A joining window does not open a port on the network. It runs a small server on
127.0.0.1 only, on a random port,
and the hub forwards the actions for that window to it.
- A window that opens later joins within a few seconds.
- If the hub's window closes, another window takes over the port within a few seconds, and the page reconnects by itself.
- Couch Remote: Stop Server, from any window, stops the server for all windows. Open pages stop reconnecting and
show Reconnect.
- Set
couchRemote.joinRunningServer to false in a workspace's settings to keep that window out of the picker.
All windows use the same access token, so the URL stays the same.
Settings
| Setting |
Default |
Description |
couchRemote.host |
0.0.0.0 |
Address the server binds to. 0.0.0.0 lets other devices on the network connect; 127.0.0.1 allows only this computer. |
couchRemote.port |
7878 |
Port of the server. |
couchRemote.autoStart |
false |
Start the server when VS Code starts. |
couchRemote.joinRunningServer |
true |
Make this window available through a server that another VS Code window already runs. |
host, port and autoStart are only read from your user settings (or, with remote development, the remote
machine's settings), so a repository you open cannot start the server or change where it listens.
The environment variable COUCH_REMOTE_TOKEN sets a fixed access token instead of the stored one, for scripts and
automated tests.
Commands
- Couch Remote: Start Server
- Couch Remote: Stop Server, for all windows
- Couch Remote: Show Connection URL, to copy the URL of one of this computer's addresses
- Couch Remote: Regenerate Access Token. Connected devices are disconnected and need the new URL; all windows switch
to the new token.
Security and privacy
Anyone with the access token can start your launch configurations, evaluate code in your debugger, discard changes
and push. Treat the URL and the QR code like a password.
- The server is off until you start it, or turn on
couchRemote.autoStart.
- Every request needs the token, except loading the page itself. The token is 192 random bits, kept in VS Code's
secret storage.
- VS Code windows never send the token to each other. They exchange messages sealed with a key derived from it, so a
program that pretends to be the server learns neither the token nor what your windows send.
- The page only runs its own code (it is served with a strict Content Security Policy) and only talks to your computer.
- The extension sends no telemetry and contacts no other service.
- The Couch Remote output channel logs every action with the address of the device that asked for it.
- Traffic is plain HTTP. On a network you do not trust, such as public Wi-Fi, other devices could read the token and
your code: use one of the options below instead of the network directly.
- Regenerate the token if you think someone else has seen it.
To report a vulnerability, see SECURITY.md.
Access from outside your network
Do not forward the port on your router. Use one of these instead:
- Tailscale or another VPN: keep
host at 0.0.0.0 and open the URL with the computer's VPN address.
- SSH tunnel: set
host to 127.0.0.1, run ssh -L 7878:localhost:7878 your-computer on the other device and
open http://localhost:7878/#token=… there.
With remote development (SSH, WSL or containers), the extension and its server run on the remote machine, so the
device needs to reach that machine.
HTTP API
The page uses this API, and scripts can use it too. Send the token in the Authorization: Bearer <token> header.
GET / serves the page (no token needed).
GET /api/hello identifies the server (no token needed).
GET /api/state returns {"result": {"windows": [...]}}. Each window has an id, a name, its folders, and
its debug and scm state.
GET /api/events is an event stream. EventSource cannot set headers, so this route also accepts ?token=<token>.
state: the full state of all windows, sent on every change.
output: a batch of new debug console lines. Each line has a windowId.
output-backlog: the buffered console lines, sent once on connect.
stopped: the server was stopped in VS Code.
POST /api/rpc with the body {"window": "<window id>", "method": "...", "params": {...}} returns
{"result": ...} or {"error": "..."}. Without window, the hub's window runs the method.
| Method |
Params |
debug.start |
folder (workspace folder URI, omit for configurations of the workspace file), name, noDebug |
debug.action |
sessionId, action: continue, pause, stepOver, stepInto, stepOut, restart, stop |
debug.evaluate |
sessionId, expression, optional frameId |
debug.scopes |
sessionId, frameId |
debug.variables |
sessionId, ref |
debug.clearEnded |
none |
scm.stage, scm.unstage, scm.discard |
root, paths (absolute paths) |
scm.commit |
root, message, stageAll |
scm.setMessage |
root, message |
scm.fetch, scm.pull, scm.push, scm.branches |
root |
scm.checkout |
root, ref |
scm.createBranch |
root, name |
scm.diff |
root, path, group: staged, changes or merge |
Example:
curl -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"window":"<window id>","method":"debug.start","params":{"folder":"file:///path/to/project","name":"Launch Program"}}' \
http://192.168.1.20:7878/api/rpc
The /api/peer/… routes are for other VS Code windows only; they only accept messages sealed with the token.
Requirements
- VS Code 1.90 or later, on a computer that the device can reach over the network.
- The built-in Git extension, for Source Control.
- A current browser on the device. No app is needed.
Known limitations
- Only launch configurations stored in
.vscode/launch.json or the .code-workspace file are listed, not those in
user settings.
- Breakpoints cannot be added or removed from the page yet.
- Restarting a session that is not the active one stops it and starts it again with its resolved configuration.
- The debug console keeps the latest 1000 lines of each session, and shortens very long lines.
- Windows only join a hub on the same computer. With remote development, windows on different machines each need their
own server.
- Couch Remote does not run in Restricted Mode or in virtual workspaces, because it starts launch configurations and
runs Git on the workspace's files.
Development
npm install
npm run compile # or press F5 in VS Code to launch an Extension Development Host
npm test # unit tests for the server, the sealed window link, and windows talking to each other
npm run package # builds a .vsix
src/extension.ts: activation, commands, status bar, and the choice of role (hub, joined window, or off).
src/local.ts: this window's state and actions.
src/hub.ts: the window that owns the port. It serves the page, combines all windows' state and forwards actions.
src/peer.ts: a window that joined a hub. It pushes its state and receives actions on 127.0.0.1.
src/link.ts: seals the messages between windows with a key derived from the access token.
src/server.ts: HTTP server, token check, event stream, the page's files, and calls to other windows.
src/debug.ts: debug session tracking (a debug adapter tracker) and DAP requests.
src/scm.ts: wrapper around the built-in Git extension API, and diffs with the git CLI.
src/gitTypes.ts: the subset of the Git extension API types that the extension uses.
src/panel.ts, media/panel.js, media/panel.css: the Couch Remote view in the Activity Bar.
media/web/: the page for other devices (plain HTML, CSS and JavaScript, no build step) and its icons.
media/icon.svg, media/app-icon.svg, media/web/favicon.svg, media/activity-bar.svg: the icon sources.
media/icon.png (256 px) is rendered from icon.svg, and media/web/apple-touch-icon.png (180 px),
icon-192.png and icon-512.png from app-icon.svg. The favicon is a simpler version that stays legible at 16 px.
Note user-facing changes under ## Unreleased in CHANGELOG.md. Releases are made by running the
Publish workflow on GitHub, which picks the next version, renames that section to it, and publishes to the Visual
Studio Marketplace and Open VSX.
Issues and pull requests are welcome. For larger changes, please open an issue first to discuss the idea.
License
MIT. The QR code generator in media/vendor/qrcode.js is
qrcode-generator by Kazuhiko Arase, also under the MIT license;
see ThirdPartyNotices.txt.
| |