Hook Development for Claude Code Plugins
anthropics/claude-plugins-official
Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.
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.
$ npx skills add sangrokjung/claude-forge --skill relay -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install sangrokjung/claude-forge relay --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ 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-srcUse ~/.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/
Install the "relay" agent skill from https://github.com/sangrokjung/claude-forge/tree/main/skills/relay into .claude/skills/relay/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "relay", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/sangrokjung/claude-forge/tree/main/skills/relayType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add sangrokjung/claude-forge --skill relay -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install sangrokjung/claude-forge relay --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sangrokjung/claude-forge.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/relay .agents/skills/relay && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "relay" agent skill from https://github.com/sangrokjung/claude-forge/tree/main/skills/relay into .agents/skills/relay/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "relay", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add sangrokjung/claude-forge --skill relay -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install sangrokjung/claude-forge relay --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sangrokjung/claude-forge.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/relay .cursor/skills/relay && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "relay" agent skill from https://github.com/sangrokjung/claude-forge/tree/main/skills/relay into .cursor/skills/relay/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "relay", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/sangrokjung/claude-forge.git --path skills/relay--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add sangrokjung/claude-forge --skill relay -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install sangrokjung/claude-forge relay --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sangrokjung/claude-forge.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/relay .gemini/skills/relay && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "relay" agent skill from https://github.com/sangrokjung/claude-forge/tree/main/skills/relay into .gemini/skills/relay/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "relay", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install sangrokjung/claude-forge relayInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add sangrokjung/claude-forge --skill relay -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/sangrokjung/claude-forge.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/relay .github/skills/relay && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "relay" agent skill from https://github.com/sangrokjung/claude-forge/tree/main/skills/relay into .github/skills/relay/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "relay", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add sangrokjung/claude-forge --skill relay -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install sangrokjung/claude-forge relay --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sangrokjung/claude-forge.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/relay .opencode/skills/relay && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "relay" agent skill from https://github.com/sangrokjung/claude-forge/tree/main/skills/relay into .opencode/skills/relay/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "relay", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
relaySession 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. 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.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 34d881d. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
Bash(bash:*)Bash(git:*)Bash(date:*)Bash(hostname:*)Bash(uname:*)ReadWriteGlobGrepAskUserQuestionFrom allowed-tools in the SKILL.md frontmatter.
Ships 4 files in scripts/ (Shell), which the agent can run.
Shell commands in SKILL.md call:
bashFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
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.
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.
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.
The full file from sangrokjung/claude-forge at commit 34d881d, republished under its MIT licence (© sangrokjung). 775 words, ~1,546 tokens.
.claude/skills/relay/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.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
/compactcommand 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/.
From $ARGUMENTS:
--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).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.
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].
/compact one-linerbash "$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).bash "$SKILL/scripts/relay-write-baton.sh" "<NEXT_TASK>" <path-to-collect.json or -> "<focus line>"
-.--quick)Follow references/next-prompt-spec.md to write §2 (context needed) and §4 (repro pitfalls), plus §1's body.
[from-claude].---§4--- marker to separate §2/§4), then re-run
write-baton with the prose file as the 4th argument to splice it in.(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.
--copy, which sets RELAY_COPY=1 on the write-baton
call in step 4. Even then, still emit the (c) code block.--new-session, instead of (c), tell the user to paste the entire baton into the new session (path from (a))./compact directly — the skill only produces the one-liner.~).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).
references/next-prompt-spec.md (SSOT)scripts/relay-lib.sh, relay-collect.sh, relay-build-focus.sh, relay-write-baton.shhooks/post-compact-restore.shtests/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
SKILL.md and 6 other files (scripts, references) in skills/relay of sangrokjung/claude-forge.
Open the folder on GitHubat commit 34d881d
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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Relay this skillsangrokjung/claude-forge | 852 | — | ~1.5k | Automated safety check: Pass | MIT | |
| Hook Development for Claude Code Pluginsanthropics/claude-plugins-official | 38k | 10 repos | ~4.1k | Automated safety check: Notes | Apache-2.0 | |
| Plugin Settings Patternanthropics/claude-plugins-official | 38k | 7 repos | ~3k | Automated safety check: Pass | Apache-2.0 | |
| Orca CLIstablyai/orca | 89k | 2 repos | ~593 | Automated safety check: Pass | MIT | |
| Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills | 21k | — | ~1.9k | Automated safety check: Pass | MIT | |
| Beads Task Memorygastownhall/beads | 28k | — | ~1.2k | Automated safety check: Pass | MIT |
anthropics/claude-plugins-official
Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.
anthropics/claude-plugins-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.
stablyai/orca
Operate Orca-managed worktrees, folder contexts, terminals, repos, automations, artifacts, skill sharing, worktree comments, and Orca's embedded browser…
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.
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.
slopus/happy
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.
sangrokjung/claude-forge
Master systematic debugging techniques, profiling tools, and root cause analysis to efficiently track down bugs across any codebase or technology stack.
sangrokjung/claude-forge
Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing.
sangrokjung/claude-forge
Analyze session work and automatically convert reusable patterns into Claude Code skills.
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.
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.
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…
Works with
Categories
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.
Relay fits situations like: tasks that involve Session handoff.
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.
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.
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.
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.
SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.
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.
Relay is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
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.
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.
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.