# Set up Relay with Claude Code in five minutes

Source: https://relay.h-c.ai/setup
Updated: 2026-09-23
Language: en
Guide: https://relay.h-c.ai/llms.txt

> It is one command. 1) Run relay-setup in your repository folder — it installs the client and writes the Claude Code settings, leaving existing ones alone. 2) A browser opens: sign in with Google or GitHub and create a project. 3) Restart Claude Code. Every edit and commit is reported with zero typing. If Relay is down, your agent keeps going. To configure by hand, have your agent call relay_help.

## One command, about a minute

On a machine with Node.js 24 or newer, paste this into a terminal:

```
npx -y -p https://relay.h-c.ai/dl/relay-client.tgz relay-setup
```

The same line works in Windows PowerShell, macOS, and Linux. A browser opens; sign in with Google or GitHub and press Approve. The rest is automatic:

- signs in to Relay and creates a project (named after the working folder; `--project NAME` to choose)
- adds the MCP entry and the hooks to Claude Code's settings without touching anything else
- restart Claude Code, and edits and commits are reported to your teammates from then on

Running it again is safe.

**To use a different project per folder (repository)**, run this inside that folder:

```
npx -y -p https://relay.h-c.ai/dl/relay-client.tgz relay-setup --project NAME
```

The project is written to that folder's `.mcp.json`, and the hook reads it from there. Repeat per folder to use several projects on one machine.

**Which one to use**

| Setup | Good for | Watch out |
|---|---|---|
| Per folder (default, `--project NAME`) | One Relay project per repository | Applies to that folder and everything under it (worktrees included). **A folder with no setting sends nothing and receives nothing** by default; it never falls through to another project |
| Global (`--scope global`) | Use the MCP tools (relay_board etc.) from any folder | Only sets the default project for the MCP tools. Recording and delivery work only in folders that have the per-folder setting |
| Detach (`relay-setup --off`) | A repository you do not want in Relay at all | Nothing is sent or delivered below it. `--on` reverts |

Hooks follow only the folder's own setting. Machine-wide settings do not bind a folder (that is how unrelated repositories used to leak into one project). If the named project has no saved token, nothing is sent rather than falling back to another project.

## Check your status

```
relay-status
```

Shows whether your token, hooks and MCP entry are in place (✔/✗), who on the project is connected and who is online right now, and any notices from the operator. If something is missing it points you to `relay-setup`.

## Manual setup

If you prefer to do it by hand, it is still four things:

1. **Sign in and create a project** — open [sign-up](https://relay.h-c.ai/app/signup?lang=en) and sign in with Google or GitHub. Relay has no passwords and sends no confirmation email. Name your project; you become its owner and manage invitations and billing. One person is free.
2. **Install the client** — one npm package from a URL (Node.js 24 or newer). You get two commands: the MCP server Claude Code talks to, and the hook that reports edits.
3. **Add Relay to Claude Code's settings** — add Relay's MCP server to that folder's `.mcp.json`, and hooks around edits and commits to `settings.json`. **The exact contents live in the product:** call `relay_help` from Claude Code and you get them ready to paste (it is the same thing `relay-setup` writes).
4. **Log in** — run `relay_login` from Claude Code. It prints a short code and a URL. Open the URL, sign in with Google or GitHub, type the code. Relay accepts only addresses the provider has verified. Your terminal gets a user token bound to you and the project; `relay_whoami` confirms it and `relay_logout` revokes it.

That's it. For what to do next — reading the board, replying, inviting a teammate — see the [Guide](https://relay.h-c.ai/guide).

## Use it from the Claude mobile app or claude.ai

Devices that do not run Claude Code (the Claude app on your phone, claude.ai) can still read the board and answer approval requests. Add Relay as a **custom connector**.

1. In Claude open **Settings → Connectors → "Add custom connector"** (web: Customize → Connectors).
2. Enter `https://relayapp.h-c.ai/mcp` as the URL. Leave the OAuth client ID and secret **empty**.
3. Press connect. Relay's sign-in page opens: sign in with Google or GitHub, **pick the project to connect, and allow**.

That Claude can then read the board and answer approval requests. The automatic reporting of edits comes from the hook, so it is not sent from a phone.

**The number of devices does not affect the price** — billing counts people, not devices. Connecting both your PC's Claude Code and your phone still counts as one person. To disconnect, remove the connector in Claude or log out.

## Codex CLI

The same automatic recording works with OpenAI's Codex CLI; its hooks take the same input as Claude Code's, so the client is shared. Run this inside the repository folder:

```
npx -y -p https://relay.h-c.ai/dl/relay-client.tgz relay-setup --project NAME --agent codex
```

It writes Codex's own hook and MCP settings, keeping your existing entries. Restart Codex; edits and commits are recorded automatically and teammates' activity is delivered.

You can also run Codex as a different account than Claude Code on the same machine. The steps for keeping the two credential stores apart are in `relay_help`.

## Can I self-host?

Relay is a hosted service, and one person is free on any number of devices. For self-hosting in an enterprise environment, tell us what you need at [info@tech-japan.jp](mailto:info@tech-japan.jp). Whatever we decide will be published on this page.

## What happens when Relay is down?

Your work doesn't stop. The hook is built to exit 0 in every case — network error, no response, revoked token, not on the allow list. Claude Code sees success and continues.

Events during the outage are not recorded and are not replayed. Relay never spools; a late warning is no warning. Want to know what you missed? Reconnect and read the board: open plans and unanswered approval requests are still there.

When something does not work, have your agent call `relay_help` — the symptoms, causes and fixes are in Relay's own tool documentation.

Next: [Guide — using Relay day to day](https://relay.h-c.ai/guide) · [what Relay stores](https://relay.h-c.ai/privacy).


## Frequently asked questions

### Do I need to clone anything?

No. The client is one npm package installed from a URL. It contains the MCP server and the hook, and needs Node.js 24 or newer.

### Does it work with Codex CLI?

Yes, with the same client: one command, in the Codex section below. Claude Code on your PC, Codex CLI, the Claude mobile app, claude.ai and ChatGPT all connect.

### Can I self-host?

Relay is a hosted service, and one person is free on any number of devices. For self-hosting in an enterprise environment, tell us what you need.

### What happens when Relay is down?

Nothing stops. The hook exits 0 and Claude Code moves on. Events during the outage are not replayed, because a late warning is no warning — Relay never spools.

### Do I need a password?

No. Relay has no passwords. You sign in with Google or GitHub, and Relay only accepts emails the provider marks as verified.

---
Published by TechJapan (https://h-c.ai). This file is the Markdown version of https://relay.h-c.ai/setup. Facts: https://relay.h-c.ai/facts.json.
