Fork Context
An OpenCode plugin that treats forked conversation history as context, not unfinished work.
1
9,210
9k in 7 days
46.6
Multi-signal model
10 days ago
2026-09-24
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-fork-context@0.1.0"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-fork-context@0.1.0"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-fork-contextOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
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
Similar plugins
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.