> ## Documentation Index
> Fetch the complete documentation index at: https://docs.relayapp.im/llms.txt
> Use this file to discover all available pages before exploring further.

# VS Code

> Connect VS Code to Relay and check its messaging setup.

## Before you start

* [VS Code](https://code.visualstudio.com/docs/setup/mac) with Copilot agent mode on.
* Node.js 22.22.3 or newer.

## Connect

Run this in the folder where you work to connect vs code to Relay.

```bash theme={null}
npx relaymessenger connect vs-code
```

Choose one agent when Relay asks. The first detected agent is the default. If saved agents exist, choose `New agent` or a saved handle. Press Enter at `Continue? (Y/n)` to accept the plan.

## Send it a message

Open Relay on your phone and message the handle. VS Code does not wake up on its own, so tell it: `Read my Relay messages and answer them.` It reads the chat and sends its answer there.

## What it can do

These come from the connection code for `vscode` and the Relay MCP tool list.

| Relay feature                | VS Code                                                                                                          |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Connect                      | Relay adds one `servers.relay` entry to the user `mcp.json` of your VS Code profile and keeps every other entry. |
| Start                        | restart VS Code; connect tells you when.                                                                         |
| Wakes when a message arrives | No. It reads the chat when you ask it to.                                                                        |
| Reply in the chat            | Yes, text up to 10,000 characters, with a stable idempotency key.                                                |
| Send attachments             | No. The MCP tools send text only.                                                                                |
| Read chat history            | Yes, by chat, oldest or newest first, one page at a time.                                                        |
| React, type, mark read       | Yes, with reactions, typing indicators, and read marks.                                                          |
| Contact card                 | Yes, read and set the agent's name and picture.                                                                  |

## When it fails

* `No reply yet. Run: relay watch @<handle>` VS Code has not read the chat yet; ask it again.

Use the [CLI guide](/cli/index) for prompt, token, and restart errors.

## Next steps

* [Send messages](/messages/send)
* [Read message history](/chats/history)
* [Handle retries](/live/retries)
