跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    cawa0505

    Code Relay

    v0.1.8其他
    @jimmyyen/opencode-code-relay-plugin

    OpenCode plugin that automates the Code Relay protocol (concept based on yan5xu/code-relay): cross-session and cross-repo state handoff for AI coding agents.

    GitHub 星标

    0

    月装机量

    107

    近 7 天 21

    综合评分SCORE

    30.7

    生态多维模型

    最近提交

    1 个月前

    2026-07-12

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@jimmyyen/opencode-code-relay-plugin@0.1.8"]
    }

    opencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    OpenCode plugin that automates the Code Relay protocol: cross-session and cross-repo state handoff for AI coding agents. It turns the manual HANDOFF / CHECKPOINT routine into single commands plus a session hook, so context survives across sessions and repositories without the agent starting from zero.

    Concept based on yan5xu/code-relay. Licensed MIT.

    Why

    AI coding agents lose context across sessions and across repositories. Code Relay solves this with a file-based handoff protocol, but it relies on the developer remembering to write HANDOFF docs. This plugin automates capture, cross-repo awareness, and restoration.

    Install

    # from npm
    opencode plugin add opencode-code-relay-plugin
    # or locally (during development)
    opencode plugin add .
    

    Commands

    • relay init — create relay.json at the workspace root and capture project context.
    • relay save — snapshot the current repo to .code-relay/state.json, update the root state, run Spec Sync, and render RESUME.md.
    • relay closeClosing Ritual: consistency check → delta snapshot → next_step.md → atomic commit with a session-end tag.
    • relay switch <repo> — move the active baton to another repo and load its specs/ as context.
    • relay resume — print the current repo's RESUME.md.
    • relay status — condensed view of relay.json.

    How it works

    • Relay Managerrelay.json at the workspace root holds project_context, active_baton, and a per-repo map. Per-repo snapshots live in .code-relay/state.json.
    • Spec Sync — deterministic diff of specs/**/*.spec.md (no LLM) compresses intent into the root state and powers the relay close consistency check.
    • Context Injector — renders a Resume Prompt from state + handover templates, injected automatically via the experimental.session.compacting hook and on demand via relay resume.

    State model (hybrid)

    • relay.json — machine-readable global state (workspace root).
    • <repo>/.code-relay/state.json — per-repo snapshot.
    • <repo>/.code-relay/RESUME.md — rendered, agent-readable resume prompt.
    • <repo>/.code-relay/next_step.md — next session's first action.

    Non-goals

    LLM-based spec summarization, GitHub Collaboration Mode, multi-agent swarm orchestration, and a GUI are deferred.

    License

    MIT — see LICENSE.