Relay logo

Relay

Community
sangrokjung
relay

Session relay — compresses what's been done so far (writes a one-liner for /compact) and generates a "next task" prompt (a baton) for the user to hand off. Use on requests like "relay / hand off / next session / continue after compact / baton / handoff / clean up context and continue next task." Does not run /compact itself (a skill cannot do that) — it produces the one-liner the user pastes in.

Overview

Publishersangrokjung
Repositoryclaude-forge
Skill namerelay
Stars
853
Forks
183
Bundled files
6
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by sangrokjung on GitHub. Read the source before you install it.

Installation

Install the Relay AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/sangrokjung/claude-forge/tree/main/skills/relay
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sangrokjung/claude-forge.git /tmp/claude-forge
mkdir -p .claude/skills
cp -r /tmp/claude-forge/skills/relay .claude/skills/relay
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Relay in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Relay on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Relay is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

relay — session relay (compact + next-task baton)

Think of a relay race: the runner hands off the baton before stopping. Before context fills up, this skill produces two things: ① a one-line /compact command that compresses everything so far, and ② a handoff document (a "baton") that lets the next session start running immediately on the next task.

When: context is 70%+ used, work is about to be interrupted, or the user asks to "relay / hand off / next session / baton / handoff."

Important (invariant): this skill never runs /compact directly (a skill cannot execute /compact). It only produces the one-liner the user pastes in.

Let $SKILL be the absolute path of the directory containing this SKILL.md. Scripts live in $SKILL/scripts/.

Flow

0) Parse arguments

From $ARGUMENTS:

  • First positional argument = next task (NEXT_TASK).
  • Flags: --new-session (for a brand-new session — instructs the user to paste the whole baton), --no-ask (skip the clarifying question), --quick (skip prose, skeleton only), --copy (opt-in clipboard copy — off by default, see §6).

1) Collect state

Run bash "$SKILL/scripts/relay-collect.sh" → capture one JSON object. (facts about git/plan/session-summary/tasks/artifacts) This JSON is the source of truth for every "fact." Do not retype it from memory — quote it verbatim.

2) Confirm the next task

If NEXT_TASK is empty and --no-ask was not passed, ask one AskUserQuestion: "What's the first thing to do next?" — options pulled from plan.next_unchecked / session_summary.next_steps / tasks.items in the collect JSON, plus "type it myself." Tag the answer [from-user].

3) Write the /compact one-liner

bash "$SKILL/scripts/relay-build-focus.sh" "<NEXT_TASK>" "<files>" "<decision>"

  • <files> = key files relevant to the next task (space/comma separated, optional).
  • <decision> = one line capturing a key decision to preserve (optional).

4) Write the skeleton baton immediately (guarantees an artifact even at 95% context)

bash "$SKILL/scripts/relay-write-baton.sh" "<NEXT_TASK>" <path-to-collect.json or -> "<focus line>"

  • Save the collect JSON to a file and pass its path, or pipe it via stdin with -.
  • This step leaves a valid (skeleton) baton on disk even without prose.

5) Add prose (optional — skip if --quick)

Follow references/next-prompt-spec.md to write §2 (context needed) and §4 (repro pitfalls), plus §1's body.

  • Apply the relevance filter (KEEP / one-line / DROP) based on the next task.
  • Facts come verbatim from the collect JSON; inferences get tagged [from-claude].
  • Save the prose to a temporary markdown file (use the ---§4--- marker to separate §2/§4), then re-run write-baton with the prose file as the 4th argument to splice it in.
  • Copy/prose text should read like a relaxed expert, not a stiff, over-formal tone.

6) Output (three items — (c) must always be a code block)

(a) absolute path of the baton (b) preview of the next prompt — excerpt from §1 MISSION (c) the /compact one-liner, output as a single fenced code block, verbatim

Never write (c) inline. A long inline line wraps in the terminal and becomes hard to select and copy. A code block keeps it as one selectable unit.

  • Do not put it on the clipboard by default. The clipboard is a single, volatile slot — if the user copies anything else in the meantime, the line is gone, and whatever was on the clipboard before gets silently overwritten without consent. On-screen text stays in scrollback and can be copied again anytime.
  • If clipboard is actually needed, opt in explicitly with --copy, which sets RELAY_COPY=1 on the write-baton call in step 4. Even then, still emit the (c) code block.
  • With --new-session, instead of (c), tell the user to paste the entire baton into the new session (path from (a)).

CRITICAL guards

  • Skeleton first, prose later: if context runs out at step 4, a valid baton still remains.
  • MISSION-first: oriented toward "what to do next," not a "log of what was done." §1 comes first.
  • Facts stay verbatim: pulled directly from the collect JSON. Never retype from memory.
  • Never runs /compact directly — the skill only produces the one-liner.
  • Always emit absolute paths (no relative paths, no unexpanded ~).
  • Can finish with just the skeleton if context is running low.

Opt-in auto-restore (SessionStart:compact)

hooks/post-compact-restore.sh is wired to settings.json's SessionStart (matcher "compact"). Right after /compact, this hook injects the pointer (the carryover left by write-baton) into the session exactly once (consume-once).

  • When auto-restore fires, the next task, carryover, and baton path reappear in context right after compaction.
  • If the hook doesn't fire (no pointer / expired / already consumed), it degrades gracefully to the (a) baton path above — just Read that path.

References

  • Baton 7-section template + relevance filter + prose format: references/next-prompt-spec.md (SSOT)
  • Scripts: scripts/relay-lib.sh, relay-collect.sh, relay-build-focus.sh, relay-write-baton.sh
  • Auto-restore hook: hooks/post-compact-restore.sh

Dev dependency (optional)

tests/relay.bats uses bats-core. It is not required to use the skill — only to run the test suite locally (bats tests/relay.bats from skills/relay/). If bats isn't installed, the scripts still work standalone; just skip the test run.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Relay AI skill do?

Session relay — compresses what's been done so far (writes a one-liner for /compact) and generates a "next task" prompt (a baton) for the user to hand off. Use on requests like "relay / hand off / next session / continue after compact / baton / handoff / clean up context and continue next task." Does not run /compact itself (a skill cannot do that) — it produces the one-liner the user pastes in.

Why use Relay on TypingMind?

Because you install it once and use it with any model. Relay is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Relay in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/sangrokjung/claude-forge/tree/main/skills/relay. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Relay?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Relay?

As many as you like. As long as a model supports skills, you can use Relay with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Relay AI skill free?

Yes. It is published on GitHub by sangrokjung under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇