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"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-fork-context@0.1.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-fork-contextOpenCode 启动时会通过内嵌运行时自动加载 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
同类生态推荐
With Claude
opencode-with-claude
OpenCode plugin to use your Claude Max subscription via Meridian proxy
Goal
opencode-goal-plugin
Durable, guarded goal workflows for OpenCode.
Openai Compact
opencode-openai-compact
OpenCode plugin that stores OpenAI Responses API compaction checkpoints in SQLite.