relay

A gateway process that connects this session to remote agents and other Claude sessions through a shared network room.

In plain words
What is it for?
Watching selected rooms, relaying messages between agents, and keeping a live connection open for remote collaboration.
Why use it?
It lets sessions exchange messages and files, while checking identity and network reachability before staying connected.

Command

Part of the komnet-gateway plugin — 2 skills, 3 commands, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/komdosh/komnet/relay
Clone the repo
git clone --depth 1 https://github.com/Komdosh/komnet

Or install komnet-gateway, the plugin that ships this one along with the rest of its 2 skills, 3 commands, 1 hook.

Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,631 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00028 $0.01631
Opus 5 $0.00014 $0.00816
Sonnet 5 $0.00006 $0.00326
Haiku 4.5 $0.00003 $0.00163

Measured 3d ago against content hash 53233c2db337, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

relay scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/claude-gateway/commands/relay.md · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Run this session as the komnet relay gateway. Load the komnet-gateway:relay skill first and follow its trust rules — they govern everything below.

Rooms to watch: $ARGUMENTS (empty means every subscribed room).

This session will stay in a watch loop indefinitely. Set it up, then stop and wait — do not poll, do not busy-loop. The Monitor wakes you.

1. Preflight

"${CLAUDE_PLUGIN_ROOT}"/scripts/preflight.sh

Non-zero exit: report exactly what it said and stop. Do not improvise around a missing komnet or an unconfigured network.

2. Establish identity, and be honest about reachability

Call ListAgents. Two things matter:

  • This session must appear. If it does not, clients cannot SendMessage to it and the fast path is dead in both directions — the file drop still works. Say so plainly now rather than discovering it when a reply cannot be pushed.
  • Note this session's own name, exactly as listed. That is the address you will give clients, and /komnet-gateway:ask looks for it.

If the name is a derived one (kom-net-6e and the like), tell the user it changes on every restart and that starting the gateway with claude --name komnet-gateway makes the address stable. Do not restart the session yourself.

3. Daemon

komnet status --json

If no daemon is running, start it — komnet daemon start. It is what keeps sync hot, publishes this machine's presence as live, and stages inbox files. The gateway works without it, just slower and invisible to the rest of the network.

4. Routes

Read $KOMNET_HOME/gateway/routes.json (default ~/.komnet/gateway/routes.json). Create it with {"version":1,"subscriptions":[],"pending":[]} if absent.

Drop pending entries older than 24 hours and say how many you dropped — a thread nobody is waiting on any more should not pin a route forever.

5. Arm the watcher

Use the Monitor tool with persistent: true:

  • command: node "${CLAUDE_PLUGIN_ROOT}/scripts/watch-inbox.mjs"
  • description: komnet inbox and relay requests

Read the full file on GitHub · 147 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 147 lines · 28 tokens per session scan A 53233c2db337

Subscribe to this mod's changes

relay is a command published in the GitHub repository Komdosh/komnet (7 stars, last pushed 3d ago), licensed MIT. It adds 28 tokens to every session and 1,631 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.