VS Code Agent Host
VS Code Agent Host is included with Visual Studio Code and verified with Agent Console. It supports multiple agent harnesses, including GitHub Copilot and Claude; availability depends on the installed VS Code version and account configuration. Agent Console connects to it through the Agent Host Protocol.
Check the available options
Section titled “Check the available options”Make Visual Studio Code’s code command available in your shell, then run:
code agent host --helpThe output for your installed version lists the available host modes and options.
Direct connection
Section titled “Direct connection”To make the host reachable from another device on the same local network or VPN, run:
code agent host --host 0.0.0.0This binds the host to all network interfaces. The host uses a connection token unless
you explicitly disable that behavior. It prints a WebSocket URL containing the token.
Use --help to choose a specific interface or port instead.
In Agent Console:
- Open Add Host.
- Enter a name under Direct Connection.
- Paste the complete WebSocket URL.
- Tap Add.
The app probes the URL before saving it. Keep the complete URL private because its token grants access to the host.
See Connections for network and TLS guidance.
Cloud tunnel
Section titled “Cloud tunnel”To publish the host through Microsoft Dev Tunnels, run:
code agent host --tunnelThen, in Agent Console:
- Open Add Host.
- Under Tunnel Connection, choose Microsoft Dev Tunnels.
- Sign in with the GitHub account that owns the tunnel.
- Select the tunnel created for the agent host.
Agent Console resolves the tunnel address when it connects. Offline hosts remain visible and can reconnect without editing a saved URL.
Agent and tunnel accounts
Section titled “Agent and tunnel accounts”The Microsoft Dev Tunnels sign-in authorizes access to the tunnel. An agent using a model provided through GitHub Copilot can request a separate sign-in through the host. Both use GitHub device flow, but Agent Console treats them as separate sign-ins and stores separate tokens, even when you use the same GitHub identity.
Protocol compatibility
Section titled “Protocol compatibility”If Agent Console reports an unsupported protocol version, update VS Code and try again. The negotiated AHP version for a connected host is available in its detail screen.