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.

MITAuto-check passedAgent Workflows

Install Relay

skills CLI
$ npx skills add sangrokjung/claude-forge --skill relay -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sangrokjung/claude-forge relay --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sangrokjung/claude-forge.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/relay .claude/skills/relay && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
relay
GitHub stars
852
Token cost
~1.5k tokens
SKILL.md length
775 words
Files
7 (incl. scripts, references)
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Works in 7 steps: Parse arguments → Collect state → Confirm the next task → …
  • Tasks that involve Session handoff
  • SKILL.md covers Flow, CRITICAL guards, Opt-in auto-restore… and References, plus 1 more section
  • Runs Shell scripts from its folder; calls bash

What it does

Relay is an agent skill from sangrokjung/claude-forge. 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.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts and reference files (for example `references/next-prompt-spec.md`, `scripts/relay-build-focus.sh` and `scripts/relay-collect.sh`).

It sits in Agent Workflows, covering Session handoff. It works with Bash. The repository describes itself as: oh-my-zsh for Claude Code — 16 agents, 35 commands, 32 skills, 21 safety hooks in one install. v4.0 adds an adversarial review loop: a second agent that never sees the first… The licence is MIT.

When your agent uses it

  • Tasks that involve Session handoff

Example prompts

  • “s been done so far (writes a one-liner for /compact) and generates a”
  • “prompt (a baton) for the user to hand off. Use on requests like”
  • “/relay”

Requirements

  • A Bash shell
  • Pre-approved tools (allowed-tools): Bash(bash:*), Bash(git:*), Bash(date:*), Bash(hostname:*), Bash(uname:*), Read, Write, Glob, Grep, AskUserQuestion

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Parse arguments
  2. Collect state
  3. Confirm the next task
  4. Write the /compact one-liner
  5. Write the skeleton baton immediately (guarantees an artifact even at 95% context)
  6. Add prose (optional — skip if --quick)
  7. Output (three items — (c) must always be a code block)

What it can do on your machine

Read from SKILL.md and the folder at commit 34d881d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(bash:*)
    • Bash(git:*)
    • Bash(date:*)
    • Bash(hostname:*)
    • Bash(uname:*)
    • Read
    • Write
    • Glob
    • Grep
    • AskUserQuestion

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 4 files in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Relay loads about 1.5k tokens when it runs, and up to ~2.5k if it reads all its reference files. Until then it costs about 101 tokens; SKILL.md has 775 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from sangrokjung/claude-forge at commit 34d881d, republished under its MIT licence (© sangrokjung). 775 words, ~1,546 tokens.

Download SKILL.mdSave it as .claude/skills/relay/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
relay
description
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.
allowed-tools
Bash(bash:*), Bash(git:*), Bash(date:*), Bash(hostname:*), Bash(uname:*), Read, Write, Glob, Grep, AskUserQuestion
disable-model-invocation
true

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.
Show full SKILL.md (371 more words)Show less
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.

© sangrokjung, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references) in skills/relay of sangrokjung/claude-forge.

  • SKILL.md
  • references/next-prompt-spec.md
  • scripts/relay-build-focus.sh
  • scripts/relay-collect.sh
  • scripts/relay-lib.sh
  • scripts/relay-write-baton.sh
  • tests/relay.bats

Open the folder on GitHubat commit 34d881d

Compare with similar skills

Relay next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Relay compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Relay this skillsangrokjung/claude-forge852—~1.5kAutomated safety check: PassMIT
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official38k10 repos~4.1kAutomated safety check: NotesApache-2.0
Plugin Settings Patternanthropics/claude-plugins-official38k7 repos~3kAutomated safety check: PassApache-2.0
Orca CLIstablyai/orca89k2 repos~593Automated safety check: PassMIT
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
Beads Task Memorygastownhall/beads28k—~1.2kAutomated safety check: PassMIT

Similar skills

  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    38k GitHub starsUsed in 10 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Plugin Settings Pattern

    anthropics/claude-plugins-official

    Official

    Shows how Claude Code plugins keep per-project settings and state in .claude/plugin-name.local.md files with YAML frontmatter and a markdown body.

    38k GitHub starsUsed in 7 repos~3k tokens
    Agent WorkflowsAuto-check passed
  • Orca CLI

    stablyai/orca

    Operate Orca-managed worktrees, folder contexts, terminals, repos, automations, artifacts, skill sharing, worktree comments, and Orca's embedded browser…

    89k GitHub starsUsed in 2 repos~593 tokens
    Agent WorkflowsAuto-check passed
  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 9 days ago
    Agent WorkflowsAuto-check passed
  • Beads Task Memory

    gastownhall/beads

    Tracks multi-session work with dependencies in the bd issue tracker so the agent can find ready tasks and recover its context after conversation compaction.

    28k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Searches past Claude Code, Codex and Cursor sessions and summarizes what was worked on, tried or decided, using extraction scripts instead of reading raw logs.

    24k GitHub stars~3.1k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from sangrokjung/claude-forge

All 24 skills in this repo
  • Debugging Strategies

    sangrokjung/claude-forge

    Master systematic debugging techniques, profiling tools, and root cause analysis to efficiently track down bugs across any codebase or technology stack.

    852 GitHub starsUsed in 13 repos~3.1k tokens
    Auto-check passed
  • Dependency Upgrade

    sangrokjung/claude-forge

    Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing.

    852 GitHub starsUsed in 12 repos~2.3k tokens
    Auto-check passed
  • Skill Factory

    sangrokjung/claude-forge

    Analyze session work and automatically convert reusable patterns into Claude Code skills.

    852 GitHub stars~2.7k tokensUpdated 1 mo ago
    Auto-check passed
  • Cc Dev Agent

    sangrokjung/claude-forge

    A skill your agent uses when starting Claude Code projects, writing CLAUDE.md/spec.md, dispatching subagents, or requesting Agent Teams parallel development.

    852 GitHub stars~771 tokensUpdated 1 mo ago
    Auto-check passed
  • Continuous Learning V2

    sangrokjung/claude-forge

    Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.

    852 GitHub starsUsed in 5 repos~1.8k tokens
    Auto-check passed
  • Harness Diet

    sangrokjung/claude-forge

    Measure and shrink the always-loaded context of a Claude Code harness (CLAUDE.md + rules without paths frontmatter) back under budget — migrate narrative to reference files, convert rules to…

    852 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Relay

What does Relay 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. Relay is an agent skill from sangrokjung/claude-forge. 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.

When should I use Relay?

Relay fits situations like: tasks that involve Session handoff.

How do I install Relay in Claude Code?

Run `npx skills add sangrokjung/claude-forge --skill relay -a claude-code`. Or copy the skill folder (skills/relay in sangrokjung/claude-forge) into .claude/skills/relay in your project. Claude Code loads it when a task matches its description.

How do I install Relay in Codex?

Run `npx skills add sangrokjung/claude-forge --skill relay -a codex`. Or copy the skill folder (skills/relay in sangrokjung/claude-forge) into .agents/skills/relay in your project. Codex loads it when a task matches its description.

Can I use Relay in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sangrokjung/claude-forge --skill relay -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/relay, .gemini/skills/relay, .github/skills/relay and .opencode/skills/relay in your project.

What does Relay need to run?

Going by SKILL.md and its folder, Relay needs a shell for the scripts in its folder and the command-line tools its instructions call (bash). Our summary lists: A Bash shell. Its frontmatter pre-approves these tools: Bash(bash:*), Bash(git:*), Bash(date:*), Bash(hostname:*), Bash(uname:*), Read, Write, Glob, Grep, AskUserQuestion.

Does Relay access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Relay safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Relay use?

Relay is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Relay use?

About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 980 tokens, read only when the agent opens those files.

What are the alternatives to Relay?

Skills that share tags, products or a category with Relay: Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Plugin Settings Pattern (anthropics/claude-plugins-official, 38k stars), Orca CLI (stablyai/orca, 89k stars) and Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Relay?

sangrokjung (a GitHub user) maintains it in sangrokjung/claude-forge, which has 852 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on September 3, 2026.

Source: sangrokjung/claude-forge on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.