opencode-conversation-recorder
v0.1.2
Published
Append-only JSONL recorder for OpenCode conversation bus events (with compaction boundary rollover).
Readme
OpenCode Conversation Recorder
Record OpenCode session bus events to append-only JSONL files per session, with an explicit split when compaction happens:
events_0.jsonl: pre-compaction historyevents_1.jsonl: post-compaction history (starts aftersession.compacted)
Install (local file URL)
- Build:
npm install
npm run build- Add to your OpenCode config (global
~/.config/opencode/opencode.jsonor projectopencode.json):
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["file:///ABSOLUTE/PATH/TO/opencode-conversation-recorder/dist/index.js"]
}- Enable recording:
OPENCODE_CONVERSATION_RECORD=1 \
OPENCODE_CONVERSATION_RECORD_DIR=/tmp/opencode-recordings \
opencode run 'say hello world in python'Output
- Base directory:
OPENCODE_CONVERSATION_RECORD_DIRif set- else
${worktree}/.opencode/conversations
- Per session:
${baseDir}/${sessionId}/events_0.jsonl${baseDir}/${sessionId}/events_1.jsonl(after compaction)
System prompt snapshots
This plugin also records system prompt snapshots emitted during LLM calls via
the experimental.chat.system.transform hook. These are written as JSONL lines
with type: "system.prompt" and payload:
{
"system": ["...system prompt segment 1...", "...segment 2..."]
}