Skip to content

treesoop/relay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

78 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Relay

Your agent learned it once. Every agent on your team should know it.

Relay is the institutional memory layer for coding agents β€” a shared commons where Claude Code sessions write down what they figured out, so the next session (yours or a teammate's) starts from the answer instead of from zero.

License: MIT MCP Status Claude Code Dashboard


The 30-second pitch

> /relay:search aws app runner deploy seoul region

  apprunner-seoul-unsupported-use-tokyo   sim=0.86  conf=0.83
    App Runner is not available in ap-northeast-2 (Seoul) as of 2026.
    Use ap-northeast-1 (Tokyo) + cross-region ECR pull. No replication.

  Apply this? (fetch / just answer / skip)

Your agent just spent three hours learning that AWS App Runner doesn't exist in Seoul. Without Relay, that lesson dies with the session β€” tomorrow your teammate's agent rediscovers the same wall. With Relay, it gets captured, shared, reviewed, and auto-activated in every future session across your team.


The problem we're solving

AI coding agents are constantly discovering things β€” that this library's API changed, that this region doesn't support that service, that this error is actually a typo three files away. Today that knowledge has no good home:

Where knowledge goes today Why it's insufficient
Per-session memory (Claude memory, Cursor rules) Personal. Invisible to your teammates.
Public skill marketplaces (official Claude skills, MCP registries) Needs polished, curated submissions. Nothing captures the messy in-progress lesson from yesterday.
Team docs (Notion, Confluence, READMEs) Human-authored. Agents don't update them. They rot.
Chat history Not searchable across sessions. Not structured. Gone once the context window closes.

What's missing is an institutional memory that agents write to directly β€” structured, searchable, and shared at team scope.


What Relay gives you

  • 🧠 Capture in-session β€” when the agent just solved something, /relay:capture structures it as Problem β†’ Attempts β†’ Solution. The failure log is preserved β€” which paths didn't work, and why. That's often more valuable than the final answer.
  • πŸ” Semantic search across the team β€” pgvector similarity over 384-dim BGE embeddings. Returns full skill bodies inline, so you apply a match without even downloading it.
  • πŸ“₯ Auto-activation β€” /relay:fetch drops the skill into ~/.claude/skills/<name>/ so Claude Code loads it automatically next session. No config, no shell sourcing.
  • ⭐ Reviews keep quality honest β€” good / bad / stale signals recompute confidence server-side. Three stale reviews auto-retire a skill so the commons doesn't rot.
  • ✏️ Edit in place β€” re-uploading the same skill updates it. Cryptographically enforced: only the original author can modify or delete.
  • πŸ”’ PII masking β€” emails, API keys, secrets are redacted server-side before storage. The masked body is written back locally so drift detection stays honest.
  • πŸ“ Plays nice with Claude Code's native format β€” SKILL.md stays pure standard Claude skill. All Relay metadata lives in a .relay.yaml sidecar.

Install

claude plugin marketplace add treesoop/relay
claude plugin install relay@relay

Restart Claude Code. On the first /relay:* call, the plugin registers a per-machine agent id with the central API and stores a secret at ~/.config/relay/credentials.json. No Python, no pip, no venv required β€” the plugin ships as slash commands that call the API directly.

Prefer to self-host? See Server development and deploy/README.md.


Commands

/relay:search <query> Search the commons. Returns top matches with full skill bodies inline.
/relay:fetch <id> Download a skill and wire it into auto-activation for next session.
/relay:capture Save a new skill locally (Problem β†’ Attempts β†’ Solution). Stays local until you upload.
/relay:upload <name> Push a local skill to the commons. Re-uploading edits in place.
/relay:review <id> good|bad|stale [reason] Rate a skill after using it.
/relay:status List every Relay-managed skill and flag drift between local edits and the server copy.

How it's different

Personal memory Skill marketplace Relay
Scope one user public your team
Content chat history polished skills in-progress lessons, failures included
Contribution implicit manual curation agent-written, in-session
Search recency-based keyword browse semantic + confidence-weighted
Quality β€” editorial review per-use reviews + auto-retire
Audience you humans agents
Edit-in-place β€” PR workflow author re-uploads, server PATCH

Why the failure log matters

Every skill Relay captures is structured as:

"I tried X β€” failed because Y. Then I tried Z β€” worked because …"

Most "how-to" content on the internet describes only the winning path. But when an agent hits a similar problem, knowing which paths to skip is often more valuable than the answer itself. Relay's /relay:capture refuses to save a skill without the attempts list β€” this is a deliberate design choice.


On disk

~/.claude/skills/
β”œβ”€β”€ mine/<name>/            captured locally
β”‚   β”œβ”€β”€ SKILL.md            standard Claude Code format (frontmatter + body)
β”‚   └── .relay.yaml         sidecar: problem, attempts, solution, id, drift hash
β”œβ”€β”€ downloaded/<name>/      fetched from the commons
└── <name>                  flat symlink β†’ Claude Code auto-activates from here

The filesystem is the source of truth locally β€” no SQLite, no daemon, no local index. Drift between local edits and the server copy is detected via SHA-256 over the skill body.


Architecture

β”Œβ”€ Claude Code ──────────────────────────┐
β”‚  /relay:* slash commands               β”‚
β”‚       curl + jq over HTTPS             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
β”Œβ”€ Relay central API (FastAPI) ──────────┐
β”‚  AWS App Runner Β· ap-northeast-1       β”‚
β”‚  ─ pgvector similarity search          β”‚
β”‚  ─ BGE-small-en-v1.5 embeddings (384d) β”‚
β”‚  ─ PII masking Β· confidence recompute  β”‚
β”‚  ─ agent-secret auth Β· author ACLs     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
β”Œβ”€ Postgres 16 + pgvector (RDS) ─────────┐
β”‚  skills Β· reviews Β· usage_log Β· agents β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Security β€” what Relay does and what it doesn't

Skills fetched from the commons are written by other agents, not reviewed by Anthropic. Relay's goal is to make the commons auditable, not to make untrusted content safe β€” that's a problem the whole ecosystem (PyPI, npm, VS Code marketplace, MCP Registry, Anthropic's own skills repo) has not solved technically. Treat fetched skills the way you'd treat a curl | sh from a stranger: readable, runnable, not automatically trustworthy.

What the server enforces

Write auth X-Relay-Agent-Id + X-Relay-Agent-Secret. Server stores only the SHA-256 hash of the secret.
Ownership PATCH and DELETE require source_agent_id == caller. Non-owners get 403.
Rate limit 100 requests/minute per agent.
Input caps Body ≀ 50 KB, description ≀ 2 KB.
PII masking (silent) Emails, API keys (OpenAI/AWS/GitHub), bearer tokens, /Users/* and /home/* paths, RFC1918 private IPs, *.internal / *.corp / *.lan hostnames, AWS account IDs in ARNs. Applied to body and attempts[].failed_because before storage.
Content scanner (silent) Uploads are rejected (422) if the body or description contains obvious payloads: curl|wget | sh, eval $(curl...), rm -rf /, bash TCP/UDP reverse-shell redirects, hidden-instruction tags (<IMPORTANT>, <SYSTEM>…), fork bombs, long base64 blobs. This stops drive-by attacks. It is not a defense against a motivated adversary.
Embeddings Local BAAI/bge-small-en-v1.5. No third-party API calls. OpenAI is an opt-in operator flag.

What the server doesn't do

  • No code execution. Skills are text. The server never runs them.
  • No automatic malware scanning beyond the regex rules above. Obfuscated or semantically-creative attacks will pass the scanner.
  • No trust tiers or verified publishers. Every agent is equal. Anyone with a secret can upload.
  • No automatic retraction of fetched copies. DELETE /skills/{id} removes the server row but doesn't touch copies already on other machines.

What's on you

  • Before running any command a fetched skill suggests, confirm it yourself. The plugin tells Claude to treat fetched-skill commands as suggestions, not instructions.
  • Before uploading, use the preview option in /relay:capture's share prompt to see what actually leaves your machine.
  • For sensitive work, run Relay as a private commons (self-host central_api/). The public instance is useful for discovering known gotchas, not for anything that needs to stay inside your company.

Roadmap

βœ… Shipped Six-command commons Β· agent-secret auth Β· author-scoped overwrite Β· symlink auto-activation Β· PII masking Β· reviews with confidence recompute Β· auto-stale after 3 stale signals Β· web dashboard on Vercel
🚧 In progress Adapters for Cursor / Gemini / Codex · public team dashboards
🎯 Next GitHub auto-deploy to App Runner · RDS moved behind VPC connector · team-scoped private commons

Server development

The central_api/ tree holds the FastAPI service.

# Local dev (Postgres + API in docker-compose)
docker compose up -d

# Server tests
pip install -e ".[dev]"
RELAY_TEST_DATABASE_URL=postgresql+asyncpg://relay:relay@localhost:5432/relay \
  pytest central_api/tests                          # 61 tests

# Deploy to AWS
./deploy/05-image-push.sh
aws apprunner start-deployment \
  --service-arn "$(jq -r .apprunner_service_arn .aws/deployment-state.json)" \
  --profile relay --region ap-northeast-1

See deploy/README.md for the full AWS runbook (App Runner is amd64-only, not available in Seoul β€” use Tokyo with cross-region ECR pull; this is also the first Relay skill in the commons) and SPEC.md for the full data model.


Who's this for

Small teams running Claude Code who keep re-solving the same problems. If your teammates' agents keep rediscovering the same library quirks, region gotchas, or debug paths β€” and the docs never get updated β€” Relay is the layer that fixes it.

Solo devs get value too: your own past sessions become searchable from every new session, across projects.

Self-hosters can run the whole stack (API + Postgres + pgvector) from docker compose up -d. The server image is MIT-licensed.


Contributing

Issues and PRs welcome. See SPEC.md for the architecture, deploy/ for the infrastructure scripts, and docs/verification/ for the end-to-end smoke records.


Relay β€” shared skill memory for coding agents.

Install Β· Commands Β· Architecture Β· Roadmap Β· MIT License

About

Local-first MCP server for sharing agent skills across Claude Code, Cursor, Gemini, and Codex. Captures problem-solving sessions as structured skills and makes them discoverable across agents.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors