跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    davdroman

    Fork Context

    opencode-fork-context·v0.1.0·其他

    An OpenCode plugin that treats forked conversation history as context, not unfinished work.

    GitHub 星标

    1

    月装机量

    9,210

    近 7 天 9k

    综合评分

    46.6

    生态多维模型

    最近提交

    10 天前

    2026-09-24

    快速安装与配置

    opencode.json

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

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-fork-context@0.1.0"]
    }

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

    Give forked OpenCode sessions a fresh task without losing the conversation’s context.

    When you fork a session, the agent inherits its history—including unfinished plans and earlier requests. This plugin tells the agent that your first prompt after the fork establishes the new task, so you don’t have to keep saying “don’t continue what you were doing.”

    Installation

    Requires OpenCode V2.

    Install through OpenCode’s CLI:

    opencode plugin add opencode-fork-context
    

    Or add the package to your opencode.jsonc:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugins": ["opencode-fork-context"]
    }
    

    You can also install directly from GitHub:

    opencode plugin add github:davdroman/opencode-fork-context
    

    How it works

    Before each agent model request, the plugin checks the session’s fork metadata. For forked sessions, it adds these instructions:

    Treat inherited conversation history as background context, not an active assignment.

    The first user prompt after the fork establishes this session’s task. Do not resume unfinished work from the source session unless explicitly requested.

    Subsequent prompts follow the task established in this fork; this reminder does not reset that task on each turn or tool continuation.

    The instruction also identifies the source session. It stays present across turns and tool calls, while ordinary sessions receive no additional instructions.

    The plugin guides the agent through its system instructions; it does not delete history or block tools. You can still ask a fork to continue the original task.

    License

    MIT

    同类生态推荐