Ø
Tensorpunk  Labs  // RELAY

One prompt, hands-off setup

If you're running Claude Code already, paste the prompt below into any session. The agent will clone the repo, build the CLI, link it globally, configure local SQLite storage, install the using-relay skill into ~/.claude/skills/, register the MCP server in your Claude Code config, and verify everything works. Then restart Claude Code so the new skill and MCP server register.

# Paste this into Claude Code

I want to set up Relay on this machine. Its public repo is
https://github.com/tensorpunk-labs/relay.

Please:
  1. Clone it as a sibling directory of this repo.
  2. Run pnpm install && pnpm build inside it.
  3. Link the CLI globally: pnpm --filter @relay/cli link --global.
  4. Configure local SQLite storage and set my actor identity:
     relay config set storage sqlite
     relay config set actor-id <me>
     relay config set actor-type human
  5. Install the using-relay skill: copy skills/using-relay/ into
     ~/.claude/skills/.
  6. Register the MCP server in my Claude Code config so the agent
     can deposit and pull context directly. The entry point is
     packages/mcp/dist/index.js inside the cloned relay repo.
  7. Verify the setup with relay projects list and relay --version.

If any step fails, stop and tell me what went wrong before continuing.

Not using Claude Code? The manual steps are right below.

Clone, build, and connect your Supabase backend

Relay runs against your own Supabase project. You own the data, the schema, and the storage bucket. No vendor dependency beyond Supabase itself.

Prerequisites

  • Node 22+node --version to check
  • pnpmnpm install -g pnpm if missing
  • Supabase project — free tier at supabase.com
  • Git — for cloning the repo
1

Clone and install

$git clone https://github.com/tensorpunk-labs/relay.git $cd relay $pnpm install $pnpm build
2

Create your Supabase project

Go to supabase.com, create a new project, then run the migration in the SQL editor:

-- In the Supabase SQL Editor, paste and run: -- supabase/migrations/001_initial_schema.sql -- (and any subsequent numbered migrations)

Then create a Storage bucket named context-packages (private, 50MB limit per file).

3

Set up environment

$cp .env.example .env # Edit .env with your values: SUPABASE_URL=https://your-project.supabase.co SUPABASE_ANON_KEY=your-anon-key-here
4

Configure the CLI

$relay config set core-url https://your-project.supabase.co $relay config set api-key your-anon-key $relay config set actor-id your-name $relay config set actor-type human
5

Test the connection

$relay projects list # Should return your projects (or an empty list on a fresh install) $relay status # Should return a clean project overview
Tip: Add alias relay="node /path/to/relay/packages/cli/dist/index.js" to your shell profile so relay is available globally.

Drop Relay tools into every Claude Code session

Relay ships an MCP server that exposes nine tools directly inside Claude Code. Once registered, every session can call relay_session_orient, relay_deposit, relay_orchestrate, and more — no manual CLI invocation needed.

1

Add to ~/.claude/mcp.json

Open (or create) ~/.claude/mcp.json and add the relay server entry:

{ "mcpServers": { "relay": { "command": "node", "args": ["/path/to/relay/packages/mcp/dist/index.js"], "env": { "SUPABASE_URL": "https://your-project.supabase.co", "SUPABASE_ANON_KEY": "your-anon-key-here" } } } }
Note: Replace /path/to/relay with your actual clone path. On Windows use forward slashes or escaped backslashes: X:\\path\\to\\relay.
2

Restart Claude Code

Fully quit and reopen Claude Code. The MCP server initializes on startup. You should see "relay" appear in the connected servers list.

3

Verify the connection

In a Claude Code session, ask Claude to run:

# From a Claude Code session — ask Claude to call: relay_session_orient // wake-up bundle for current project relay_status // recent packages + open questions

Or from the terminal:

$relay orient # Should print a compact markdown orientation bundle
4

Optional: SessionStart hook for auto-orientation

Add relay orient to Claude Code's SessionStart hook so every session begins pre-oriented without asking:

// In ~/.claude/settings.json: "hooks": { "SessionStart": [{ "hooks": [{ "type": "command", "command": "relay orient --quiet" }] }] }

Just talk to Claude — the CLI is optional

Once the MCP server is configured, you don't need to memorize commands or switch terminals. Claude speaks Relay natively. Ask in plain English — Claude calls the right MCP tools behind the scenes. The CLI exists for scripting, hooks, and power users.

The core pattern: tell Claude what you want to remember, pull, or synthesize. Claude uses relay_deposit, relay_pull_context, relay_orchestrate, relay_session_orient, relay_assert_fact, and relay_query_facts based on the context of the conversation.
1

Deposit your work in plain English

At the end of a meaningful unit of work, just tell Claude to remember it:

# In Claude Code, just say: "Relay deposit this unit of work — we finalized the pricing tiers" # Or more specifically: "Deposit this to Relay. Title it «Pricing finalized», include the three decisions we made, and hand off to the marketing agent."

Claude packages the context, adds a handoff note, and calls relay_deposit. You stay in the flow.

2

Pull context across sessions and projects

Starting a new session? Jumping to another project? Ask Claude to get you oriented:

# Morning session kickoff: "Relay pull the latest context from the pricing project" # Cross-project lookup: "Pull everything relevant from Relay about the partnership agreement with Titan Mining from the past two weeks" # Targeted recall: "What did we decide about dispatch timing last session? Check Relay."

Claude picks the right call — semantic search, latest packages, or filtered by project.

3

Get a state-of-the-union across projects

When you need the big picture, not just one package, use orchestrate. Claude synthesizes across everything:

# Weekly check-in: "Relay orchestrate and give me a state of the union on all active projects. What shipped this week? What's blocked?" # Focused synthesis: "Orchestrate Relay on the Kepler-62 corridor work — decisions, open questions, and risks."

Relay assembles context packages + facts + handoff notes across sessions; Claude writes the synthesis.

4

Assert current truth with facts

Packages are the immutable journal. Facts are the mutable whiteboard — use them when "the truth changed":

# Tell Claude to record current truth: "Note in Relay that Meridian-IV is now assigned to Captain Vess, replacing Captain Okoye" # Query the current state: "What's the current status of the Proxima lane? Query Relay facts."

Claude calls relay_assert_fact or relay_query_facts. Old assertions auto-supersede. No history is rewritten.

5

Auto-deposit on session exit (optional, recommended)

Install a Stop hook so every session automatically captures git state as a package. Pairs with your conversational deposits for full coverage:

# In ~/.claude/settings.json: "hooks": { "Stop": [{ "hooks": [{ "type": "command", "command": "relay deposit --auto --quiet" }] }] }

Auto-deposits capture what changed (git diff, branch, files). Your conversational deposits capture why (decisions, reasoning, intent). Both together make your session history complete.

6

When to use the CLI directly

The CLI exists for scripting, hooks, and power-user workflows. Jump to the CLI Reference when you want to:

  • Automate deposits in CI pipelines
  • Batch-query facts with --as-of time-travel
  • Build custom shell hooks beyond the Stop hook
  • Pipe orchestrate output into other tools
  • Debug or inspect the raw data layer

For day-to-day usage, conversational Relay is the whole product.

Keep the journal clean and the data portable

Two small habits keep Relay healthy as it accumulates context: archive projects when they go dormant so they stop leaking into your digests, and back up your active projects periodically so you can move, mirror, or restore them at will.

1

Archive inactive projects

When a project goes dormant, soft-archive it with relay projects archive <id>. Archiving is reversible — no data is deleted — but it stamps an archived_at timestamp that hides the project from relay projects list, drops it out of relay orchestrate's global digest, and causes auto-deposits routed to it (e.g. via the stop hook) to skip cleanly instead of polluting a dead journal. Run relay projects restore <id> to bring it back later.

# Archive a dormant project $relay projects archive proj_old_experiment # See it again later (uses the -a / --include-archived flag) $relay projects list -a # Bring it back $relay projects restore proj_old_experiment
Meta-project guard: Relay refuses to archive its own meta project (proj_dev_relay) without an explicit --force flag. The meta project tracks Relay itself; silencing it by accident would leave you blind to your own context system.
2

Back up your context

relay backup dumps a project's packages, facts, sessions, and blob deliverables to a local directory as protocol-portable NDJSON plus a blobs/ folder. The wire format is the Agentic Protocol's — any conformant implementation, not just Relay, can ingest the output. The command is read-only against the live store, so it's safe to run while Relay is in use, and it pairs naturally with cron or a scheduled task. Use it for disaster recovery, for migrating between Supabase projects, or for moving to a different Relay-compatible backend later.

# CWD-resolved project to ./relay-backup-<iso>/ $relay backup # A specific project to a chosen path $relay backup --project proj_dev_relay --out ~/backups/relay-2026-04 # Everything you have access to (one subdirectory per project) $relay backup --all-projects --out ~/backups/relay-full
Why protocol-portable matters: a backup is also a migration path. Because the NDJSON conforms to the wire format in the Agentic Protocol spec, you're never locked into Relay or Supabase — another conformant implementation can pick up where the export left off.

What's next